From: Vivek Goyal Date: Thu, 11 Jan 2007 00:52:44 +0000 (+0100) Subject: [PATCH] i386: make apic probe function non-init X-Git-Tag: v2.6.20-rc5~24^2~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e96763d6e52c22a8821466e4d01c0c995b8087be;p=linux-2.6 [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 Signed-off-by: Andi Kleen Cc: "Eric W. Biederman" Cc: Andi Kleen Signed-off-by: Andrew Morton --- diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/i386/mach-generic/bigsmp.c index 33d9f93557..8a210fa915 100644 --- a/arch/i386/mach-generic/bigsmp.c +++ b/arch/i386/mach-generic/bigsmp.c @@ -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; diff --git a/arch/i386/mach-generic/default.c b/arch/i386/mach-generic/default.c index 96c19821e4..8685208d85 100644 --- a/arch/i386/mach-generic/default.c +++ b/arch/i386/mach-generic/default.c @@ -18,7 +18,7 @@ #include /* should be called last. */ -static __init int probe_default(void) +static int probe_default(void) { return 1; } diff --git a/arch/i386/mach-generic/es7000.c b/arch/i386/mach-generic/es7000.c index aa144d8233..b8963a5a3b 100644 --- a/arch/i386/mach-generic/es7000.c +++ b/arch/i386/mach-generic/es7000.c @@ -19,7 +19,7 @@ #include #include -static __init int probe_es7000(void) +static int probe_es7000(void) { /* probed later in mptable/ACPI hooks */ return 0; diff --git a/arch/i386/mach-generic/summit.c b/arch/i386/mach-generic/summit.c index f7e5d66648..74883ccb8f 100644 --- a/arch/i386/mach-generic/summit.c +++ b/arch/i386/mach-generic/summit.c @@ -18,7 +18,7 @@ #include #include -static __init int probe_summit(void) +static int probe_summit(void) { /* probed later in mptable/ACPI hooks */ return 0;