From: H. Peter Anvin Date: Mon, 14 Jan 2013 04:36:39 +0000 (-0800) Subject: x86/Sandy Bridge: mark arrays in __init functions as __initconst X-Git-Tag: v3.4.92~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=75a0ac16ab0b957c19795a0e47d774ca614af7c7;p=thirdparty%2Fkernel%2Fstable.git x86/Sandy Bridge: mark arrays in __init functions as __initconst commit 91c90db1aa92a50fa1d7f289502b49ddb46a90d3 upstream. commit ab3cd8670e0b3fcde7f029e1503ed3c5138e9571 upstream. Mark static arrays as __initconst so they get removed when the init sections are flushed. Reported-by: Mathias Krause Link: http://lkml.kernel.org/r/75F4BEE6-CB0E-4426-B40B-697451677738@googlemail.com Signed-off-by: H. Peter Anvin Signed-off-by: Ben Hutchings Cc: Rui Xiang Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 537dc033868d5..46112cef59a7f 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -625,7 +625,7 @@ static bool __init snb_gfx_workaround_needed(void) #ifdef CONFIG_PCI int i; u16 vendor, devid; - static const u16 snb_ids[] = { + static const __initconst u16 snb_ids[] = { 0x0102, 0x0112, 0x0122, @@ -658,7 +658,7 @@ static bool __init snb_gfx_workaround_needed(void) */ static void __init trim_snb_memory(void) { - static const unsigned long bad_pages[] = { + static const __initconst unsigned long bad_pages[] = { 0x20050000, 0x20110000, 0x20130000,