aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSatyam Sharma <satyam@infradead.org>2007-10-17 12:04:35 -0400
committerThomas Gleixner <tglx@inhelltoy.tec.linutronix.de>2007-10-17 14:15:49 -0400
commit7b38493501b76e56f481925ed74ee5ca0f4c6183 (patch)
tree6ac83113f1c775d59bebe2c53da06076c3fd1ecf
parentf6855f7fb2e22c5675d292dd445ee3c1fc09ac18 (diff)
x86: intel_cacheinfo misc section annotation fixes
cache_shared_cpu_map_setup() and cache_remove_shared_cpu_map() are functions called from another function that is __cpuinit. But the !CONFIG_SMP empty-body stubs of these functions are unconditionally marked __init, which is actively wrong, and will lead to oops. But we never saw this oops, because they always managed to get inlined in their callsites, by virtue of being empty-body stubs! They should still be __cpuinit, of course. assocs[], levels[] and types[] are only referenced from function that is __cpuinit. So these are candidates for being marked __cpuinitdata. [akpm@linux-foundation.org: build fix] Signed-off-by: Satyam Sharma <satyam@infradead.org> Cc: Andi Kleen <ak@suse.de> Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index db6c25aa5776..6f9dd38029bd 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -170,15 +170,15 @@ union l3_cache {
170 unsigned val; 170 unsigned val;
171}; 171};
172 172
173static const unsigned short assocs[] = { 173static unsigned short assocs[] __cpuinitdata = {
174 [1] = 1, [2] = 2, [4] = 4, [6] = 8, 174 [1] = 1, [2] = 2, [4] = 4, [6] = 8,
175 [8] = 16, [0xa] = 32, [0xb] = 48, 175 [8] = 16, [0xa] = 32, [0xb] = 48,
176 [0xc] = 64, 176 [0xc] = 64,
177 [0xf] = 0xffff // ?? 177 [0xf] = 0xffff // ??
178}; 178};
179 179
180static const unsigned char levels[] = { 1, 1, 2, 3 }; 180static unsigned char levels[] __cpuinitdata = { 1, 1, 2, 3 };
181static const unsigned char types[] = { 1, 2, 3, 3 }; 181static unsigned char types[] __cpuinitdata = { 1, 2, 3, 3 };
182 182
183static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, 183static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
184 union _cpuid4_leaf_ebx *ebx, 184 union _cpuid4_leaf_ebx *ebx,
@@ -493,8 +493,8 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index)
493 } 493 }
494} 494}
495#else 495#else
496static void __init cache_shared_cpu_map_setup(unsigned int cpu, int index) {} 496static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) {}
497static void __init cache_remove_shared_cpu_map(unsigned int cpu, int index) {} 497static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) {}
498#endif 498#endif
499 499
500static void free_cache_attributes(unsigned int cpu) 500static void free_cache_attributes(unsigned int cpu)