Skip to contentSkip to conversation

x86/mm: Fix section mismatch

PATCH New Rakib Mullick 1 participant 1 message Feb 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: Fix section mismatch

Impact: Fix section mismatch.

Currently pat_init calls pat_disable which is annoted with __cpuinit. Thus requires pat_init to be
annoted with __cpuinit, otherwise causes the following warning.

LD arch/x86/mm/built-in.o
WARNING: arch/x86/mm/built-in.o(.text+0x1fff): Section mismatch in reference from the function pat_init() to the function .cpuinit.text:pat_disable()
The function pat_init() references
the function __cpuinit pat_disable().
This is often because pat_init lacks a __cpuinit annotation or the annotation of pat_disable is wrong.

After annotating pat_init with __cpuinit, it generates the following warning when CONFIG_x86_PAT=n.

MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0xd48b): Section mismatch in reference from the function generic_set_all() to the function .cpuinit.text:pat_init()
The function generic_set_all() references
the function __cpuinit pat_init().
This is often because generic_set_all lacks a __cpuinit annotation or the annotation of pat_init is wrong.

This patch fixes the above warnings.

---

arch/x86/mm/pat.c +1 -1
@@ -76,7 +76,7 @@ enum {
 
 #define PAT(x, y)	((u64)PAT_ ## y << ((x)*8))
 
-void pat_init(void)
+void __cpuinit pat_init(void)
 {
 	u64 pat;
 

---

arch/x86/kernel/cpu/mtrr/generic.c +1 -1
@@ -543,7 +543,7 @@ static void post_set(void) __releases(se
 	spin_unlock(&set_atomicity_lock);
 }
 
-static void generic_set_all(void)
+static void __cpuinit generic_set_all(void)
 {
 	unsigned long mask, count;
 	unsigned long flags;