linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Krause <minipli@googlemail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: Joe Perches <joe@perches.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kernel@vger.kernel.org,
	Mathias Krause <minipli@googlemail.com>
Subject: [PATCHv3 6/9] x86, mm: Make x86_init.memory_setup() return a const char *
Date: Thu, 21 Aug 2014 14:23:09 +0200	[thread overview]
Message-ID: <1408623792-7973-7-git-send-email-minipli@googlemail.com> (raw)
In-Reply-To: <1408623792-7973-1-git-send-email-minipli@googlemail.com>

All implementations of x86_init.memory_setup() actually return a const
char *.  Adjust the prototypes to reflect reality.

Also add the missing __init annotation to xen_auto_xlated_memory_setup().

Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
 arch/x86/include/asm/e820.h     |    4 ++--
 arch/x86/include/asm/x86_init.h |    2 +-
 arch/x86/kernel/e820.c          |    8 ++++----
 arch/x86/lguest/boot.c          |    2 +-
 arch/x86/xen/setup.c            |    4 ++--
 arch/x86/xen/xen-ops.h          |    4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 779c2efe2e..7d17fb2b16 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -17,7 +17,7 @@ extern unsigned long pci_mem_start;
 extern int e820_any_mapped(u64 start, u64 end, unsigned type);
 extern int e820_all_mapped(u64 start, u64 end, unsigned type);
 extern void e820_add_region(u64 start, u64 size, int type);
-extern void e820_print_map(char *who);
+extern void e820_print_map(const char *who);
 extern int
 sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map);
 extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
@@ -59,7 +59,7 @@ extern void finish_e820_parsing(void);
 extern void e820_reserve_resources(void);
 extern void e820_reserve_resources_late(void);
 extern void setup_memory_map(void);
-extern char *default_machine_specific_memory_setup(void);
+extern const char *default_machine_specific_memory_setup(void);
 
 /*
  * Returns true iff the specified range [s,e) is completely contained inside
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index e45e4da96b..64e80c9815 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -42,7 +42,7 @@ struct x86_init_mpparse {
 struct x86_init_resources {
 	void (*probe_roms)(void);
 	void (*reserve_resources)(void);
-	char *(*memory_setup)(void);
+	const char *(*memory_setup)(void);
 };
 
 /**
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 988c00a1f6..14323a7c66 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -155,7 +155,7 @@ static void __init e820_print_type(u32 type)
 	}
 }
 
-void __init e820_print_map(char *who)
+void __init e820_print_map(const char *who)
 {
 	int i;
 
@@ -1021,9 +1021,9 @@ void __init e820_reserve_resources_late(void)
 	}
 }
 
-char *__init default_machine_specific_memory_setup(void)
+const char *__init default_machine_specific_memory_setup(void)
 {
-	char *who = "BIOS-e820";
+	const char *who = "BIOS-e820";
 	u32 new_nr;
 	/*
 	 * Try to copy the BIOS-supplied E820-map.
@@ -1061,7 +1061,7 @@ char *__init default_machine_specific_memory_setup(void)
 
 void __init setup_memory_map(void)
 {
-	char *who;
+	const char *who;
 
 	who = x86_init.resources.memory_setup();
 	memcpy(&e820_saved, &e820, sizeof(struct e820map));
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index aae94132bc..28457edc2f 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -1167,7 +1167,7 @@ static struct notifier_block paniced = {
 };
 
 /* Setting up memory is fairly easy. */
-static __init char *lguest_memory_setup(void)
+static __init const char *lguest_memory_setup(void)
 {
 	/*
 	 * The Linux bootloader header contains an "e820" memory map: the
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 2e555163c2..fabe61f6f3 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -336,7 +336,7 @@ void xen_ignore_unusable(struct e820entry *list, size_t map_size)
 /**
  * machine_specific_memory_setup - Hook for machine specific memory setup.
  **/
-char * __init xen_memory_setup(void)
+const char * __init xen_memory_setup(void)
 {
 	static struct e820entry map[E820MAX] __initdata;
 
@@ -502,7 +502,7 @@ char * __init xen_memory_setup(void)
 /*
  * Machine specific memory setup for auto-translated guests.
  */
-char * __init xen_auto_xlated_memory_setup(void)
+const char * __init xen_auto_xlated_memory_setup(void)
 {
 	static struct e820entry map[E820MAX] __initdata;
 
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 28c7e0be56..da12e3413c 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -35,8 +35,8 @@ void xen_mm_pin_all(void);
 void xen_mm_unpin_all(void);
 void xen_set_pat(u64);
 
-char * __init xen_memory_setup(void);
-char * xen_auto_xlated_memory_setup(void);
+const char * __init xen_memory_setup(void);
+const char * __init xen_auto_xlated_memory_setup(void);
 void __init xen_arch_setup(void);
 void xen_enable_sysenter(void);
 void xen_enable_syscall(void);
-- 
1.7.10.4


  parent reply	other threads:[~2014-08-21 12:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 12:23 [PATCHv3 0/9] Mark literal strings in __init / __exit code Mathias Krause
2014-08-21 12:23 ` [PATCHv3 1/9] init.h: Add __init_str / __exit_str macros Mathias Krause
2014-08-21 12:23 ` [PATCHv3 2/9] printk: Provide pi_<level> / pe_<level> macros for __init / __exit code Mathias Krause
2014-08-21 12:23 ` [PATCHv3 3/9] kallsyms: exclude pseudo symbols for __init / __exit strings Mathias Krause
2014-08-21 12:23 ` [PATCHv3 4/9] modpost: provide better diagnostics " Mathias Krause
2014-08-21 12:23 ` [PATCHv3 5/9] x86, acpi: Mark __init strings as such Mathias Krause
2014-08-21 12:23 ` Mathias Krause [this message]
2014-08-21 12:23 ` [PATCHv3 7/9] x86, mm: early_panic() - pass on the message as string Mathias Krause
2014-08-21 12:23 ` [PATCHv3 8/9] x86, mm: e820 - mark __init strings as such Mathias Krause
2014-08-21 12:23 ` [PATCHv3 9/9] x86: setup " Mathias Krause
2014-08-21 12:57 ` [PATCHv3 0/9] Mark literal strings in __init / __exit code Ingo Molnar
2014-08-21 14:29   ` Mathias Krause
2014-08-22  8:24     ` Ingo Molnar
2014-08-30 15:28       ` Mathias Krause
2014-09-16  8:57         ` Ingo Molnar
2014-08-21 16:25 ` Sam Ravnborg
2014-08-24 16:04   ` Mathias Krause
2014-08-24 16:28     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408623792-7973-7-git-send-email-minipli@googlemail.com \
    --to=minipli@googlemail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).