Commit e96763d6e52c22a8821466e4d01c0c995b8087be

Authored by Vivek Goyal
Committed by Andi Kleen
1 parent 4a5d107a9a

[PATCH] i386: make apic probe function non-init

o struct genapic contains pointer to probe() function which is of type
  __init. Hence MODPOST generates warning if kernel is compiled with
  CONFIG_RELOCATABLE=y for i386.

WARNING: vmlinux - Section mismatch: reference to .init.text: from .data between 'apic_summit' (at offset 0xc058b504) and 'apic_bigsmp'
WARNING: vmlinux - Section mismatch: reference to .init.text: from .data between 'apic_bigsmp' (at offset 0xc058b5a4) and 'cpu.4471'
WARNING: vmlinux - Section mismatch: reference to .init.text: from .data between 'apic_es7000' (at offset 0xc058b644) and 'apic_default'
WARNING: vmlinux - Section mismatch: reference to .init.text: from .data between 'apic_default' (at offset 0xc058b6e4) and 'interrupt'

o One of the possible options is to put special case check in MODPOST to
  not emit warnings for this case but I think it is not a very good option
  in terms of maintenance.

o Another option is to make probe() function non __init. Anyway this function
  is really small so not freeing this memory after init is not a big deal.
  Secondly, from a programming perspective, probably genapic should not
  provide pointers to functions which have been freed as genapic is non
  __init and is used even after initialization is complete.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>

Showing 4 changed files with 4 additions and 4 deletions Side-by-side Diff

arch/i386/mach-generic/bigsmp.c
... ... @@ -45,7 +45,7 @@
45 45 };
46 46  
47 47  
48   -static __init int probe_bigsmp(void)
  48 +static int probe_bigsmp(void)
49 49 {
50 50 if (def_to_bigsmp)
51 51 dmi_bigsmp = 1;
arch/i386/mach-generic/default.c
... ... @@ -18,7 +18,7 @@
18 18 #include <asm/mach-default/mach_mpparse.h>
19 19  
20 20 /* should be called last. */
21   -static __init int probe_default(void)
  21 +static int probe_default(void)
22 22 {
23 23 return 1;
24 24 }
arch/i386/mach-generic/es7000.c
... ... @@ -19,7 +19,7 @@
19 19 #include <asm/mach-es7000/mach_mpparse.h>
20 20 #include <asm/mach-es7000/mach_wakecpu.h>
21 21  
22   -static __init int probe_es7000(void)
  22 +static int probe_es7000(void)
23 23 {
24 24 /* probed later in mptable/ACPI hooks */
25 25 return 0;
arch/i386/mach-generic/summit.c
... ... @@ -18,7 +18,7 @@
18 18 #include <asm/mach-summit/mach_ipi.h>
19 19 #include <asm/mach-summit/mach_mpparse.h>
20 20  
21   -static __init int probe_summit(void)
  21 +static int probe_summit(void)
22 22 {
23 23 /* probed later in mptable/ACPI hooks */
24 24 return 0;