mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Section mismatch warning patch - microcode.c
@ 2008-02-02  8:39 Peter Teoh
  2008-02-02 14:02 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Teoh @ 2008-02-02  8:39 UTC (permalink / raw)
  To: LKML

The following errors during compilation is corrected by the following
patch (against the latest linus tree):

WARNING: arch/x86/kernel/microcode.o(.exit.text+0x6): Section mismatch
in reference from the function cleanup_module() to the variable
.cpuinit.data:mc_cpu_notifier

Please comment.   Thanks.



diff -Nurp /tmp/microcode.c arch/x86/kernel/microcode.c
--- /tmp/microcode.c    2008-02-02 16:46:43.000000000 +0800
+++ arch/x86/kernel/microcode.c 2008-02-02 16:41:58.000000000 +0800
@@ -797,7 +797,7 @@ mc_cpu_callback(struct notifier_block *n
        return NOTIFY_OK;
 }

-static struct notifier_block __refdata mc_cpu_notifier = {
+static struct notifier_block mc_cpu_notifier __initdata = {
        .notifier_call = mc_cpu_callback,
 };

@@ -831,7 +831,7 @@ static int __init microcode_init (void)
        return 0;
 }

-static void __exit microcode_exit (void)
+static void __init microcode_exit (void)
 {
        microcode_dev_exit();

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Section mismatch warning patch - microcode.c
  2008-02-02  8:39 Section mismatch warning patch - microcode.c Peter Teoh
@ 2008-02-02 14:02 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2008-02-02 14:02 UTC (permalink / raw)
  To: Peter Teoh; +Cc: LKML

On Sat, Feb 02, 2008 at 04:39:02PM +0800, Peter Teoh wrote:
> The following errors during compilation is corrected by the following
> patch (against the latest linus tree):
> 
> WARNING: arch/x86/kernel/microcode.o(.exit.text+0x6): Section mismatch
> in reference from the function cleanup_module() to the variable
> .cpuinit.data:mc_cpu_notifier

I have missed this one when I did my last fix to that file.
But your patch is not good.

Annotating the microcode_exit() function with __init will
cause the kernel to drop the code long before we need it.

I will look into this later and post a fix for the warning.

	Sam

> @@ -831,7 +831,7 @@ static int __init microcode_init (void)
>         return 0;
>  }
> 
> -static void __exit microcode_exit (void)
> +static void __init microcode_exit (void)
>  {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-02 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-02  8:39 Section mismatch warning patch - microcode.c Peter Teoh
2008-02-02 14:02 ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®