From: Mathias Krause <minipli@googlemail.com>
To: 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>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Mathias Krause <minipli@googlemail.com>
Subject: [PATCH v2 4/8] x86, mm: Make x86_init.memory_setup() return a const char *
Date: Sat, 12 Jul 2014 16:43:28 +0200 [thread overview]
Message-ID: <1405176212-12175-5-git-send-email-minipli@googlemail.com> (raw)
In-Reply-To: <1405176212-12175-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 97d87659f7..67b97574b1 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
next prev parent reply other threads:[~2014-07-12 14:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-12 14:43 [PATCH v2 0/8] Mark literal strings in __init / __exit code Mathias Krause
2014-07-12 14:43 ` [PATCH v2 1/8] init.h: Add __init_str / __exit_str macros Mathias Krause
2014-07-12 14:43 ` [PATCH v2 2/8] printk: Provide pi_<level> / pe_<level> macros for __init / __exit code Mathias Krause
2014-07-15 23:23 ` Andrew Morton
2014-07-16 6:29 ` Mathias Krause
2014-07-12 14:43 ` [PATCH v2 3/8] x86, acpi: Mark __init strings as such Mathias Krause
2014-07-12 14:43 ` Mathias Krause [this message]
2014-07-12 14:43 ` [PATCH v2 5/8] x86, mm: early_panic() - pass on the message as string Mathias Krause
2014-07-12 14:43 ` [PATCH v2 6/8] x86, mm: e820 - mark __init strings as such Mathias Krause
2014-07-12 14:43 ` [PATCH v2 7/8] x86: setup " Mathias Krause
2014-07-12 14:43 ` [PATCH v2 8/8] kallsyms: exclude pseudo symbols for __init / __exit strings Mathias Krause
2014-07-15 23:26 ` [PATCH v2 0/8] Mark literal strings in __init / __exit code Andrew Morton
2014-07-16 6:30 ` Mathias Krause
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=1405176212-12175-5-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).