Skip to content

Commit

Permalink
[PATCH] i386: make apic probe function non-init
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Andi Kleen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Vivek Goyal authored and Andi Kleen committed Jan 11, 2007
1 parent 4a5d107 commit e96763d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/i386/mach-generic/bigsmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static struct dmi_system_id __initdata bigsmp_dmi_table[] = {
};


static __init int probe_bigsmp(void)
static int probe_bigsmp(void)
{
if (def_to_bigsmp)
dmi_bigsmp = 1;
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/mach-generic/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <asm/mach-default/mach_mpparse.h>

/* should be called last. */
static __init int probe_default(void)
static int probe_default(void)
{
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/mach-generic/es7000.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <asm/mach-es7000/mach_mpparse.h>
#include <asm/mach-es7000/mach_wakecpu.h>

static __init int probe_es7000(void)
static int probe_es7000(void)
{
/* probed later in mptable/ACPI hooks */
return 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/mach-generic/summit.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <asm/mach-summit/mach_ipi.h>
#include <asm/mach-summit/mach_mpparse.h>

static __init int probe_summit(void)
static int probe_summit(void)
{
/* probed later in mptable/ACPI hooks */
return 0;
Expand Down

0 comments on commit e96763d

Please sign in to comment.