]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: fix section mismatch warnings when referencing notifiers
authorSam Ravnborg <sam@ravnborg.org>
Fri, 1 Feb 2008 16:49:42 +0000 (17:49 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 1 Feb 2008 16:49:42 +0000 (17:49 +0100)
Fix the following warnings:
WARNING: arch/x86/kernel/built-in.o(.exit.text+0xf8): Section mismatch in reference from the function msr_exit() to the variable .cpuinit.data:msr_class_cpu_notifier
WARNING: arch/x86/kernel/built-in.o(.exit.text+0x158): Section mismatch in reference from the function cpuid_exit() to the variable .cpuinit.data:cpuid_class_cpu_notifier
WARNING: arch/x86/kernel/built-in.o(.exit.text+0x171): Section mismatch in reference from the function microcode_exit() to the variable .cpuinit.data:mc_cpu_notifier

In all three cases there were a function annotated __exit
that referenced a variable annotated __cpuinitdata.

The fix was to replace the annotation of the notifier
with __refdata to tell modpost that the reference to
a _cpuinit function in the notifier are OK.
The unregister call that references the notifier
variable will simple delete the function pointer
so there is no problem ignoring the reference.

Note: This looks like another case where __cpuinit
has been used as replacement for proper use
of CONFIG_HOTPLUG_CPU to decide what code are used for
HOTPLUG_CPU.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpuid.c
arch/x86/kernel/microcode.c
arch/x86/kernel/msr.c

index dec66e4528100c72ee384f7c5aa9400339eb26ab..a63432d800f913960f055232d02aa668e892b83e 100644 (file)
@@ -170,7 +170,7 @@ static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb,
        return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
-static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
+static struct notifier_block __refdata cpuid_class_cpu_notifier =
 {
        .notifier_call = cpuid_class_cpu_callback,
 };
index 6ff447f9fda702398aaaaef9aa8f93143c56a12d..f2702d01b8a8773a8d7658d47fd7e6c1997fdc7c 100644 (file)
@@ -797,7 +797,7 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
        return NOTIFY_OK;
 }
 
-static struct notifier_block __cpuinitdata mc_cpu_notifier = {
+static struct notifier_block __refdata mc_cpu_notifier = {
        .notifier_call = mc_cpu_callback,
 };
 
index 21f6e3c0be185c657d307042168fef4509073798..bd82850e6519b8a51d2c2a68512a7b492d864229 100644 (file)
@@ -168,7 +168,7 @@ static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
        return err ? NOTIFY_BAD : NOTIFY_OK;
 }
 
-static struct notifier_block __cpuinitdata msr_class_cpu_notifier = {
+static struct notifier_block __refdata msr_class_cpu_notifier = {
        .notifier_call = msr_class_cpu_callback,
 };