2006-08-08 08:16:17

by Magnus Damm

[permalink] [raw]
Subject: [PATCH] i386: mark two more functions as __init

i386: mark two more functions as __init

cyrix_identify() should be __init because transmeta_identify() is.
tsc_init() is only called from setup_arch() which is marked as __init.

These two section mismatches have been detected using running modpost on
a vmlinux image compiled with CONFIG_RELOCATABLE=y.

Signed-off-by: Magnus Damm <[email protected]>
---

cpu/cyrix.c | 2 +-
tsc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

--- 0001/arch/i386/kernel/cpu/cyrix.c
+++ work/arch/i386/kernel/cpu/cyrix.c 2006-08-07 17:02:58.000000000 +0900
@@ -394,7 +394,7 @@ static inline int test_cyrix_52div(void)
return (unsigned char) (test >> 8) == 0x02;
}

-static void cyrix_identify(struct cpuinfo_x86 * c)
+static void __init cyrix_identify(struct cpuinfo_x86 * c)
{
/* Detect Cyrix with disabled CPUID */
if ( c->x86 == 4 && test_cyrix_52div() ) {
--- 0001/arch/i386/kernel/tsc.c
+++ work/arch/i386/kernel/tsc.c 2006-08-07 17:02:58.000000000 +0900
@@ -192,7 +192,7 @@ int recalibrate_cpu_khz(void)

EXPORT_SYMBOL(recalibrate_cpu_khz);

-void tsc_init(void)
+void __init tsc_init(void)
{
if (!cpu_has_tsc || tsc_disable)
return;


2006-08-08 09:15:52

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] i386: mark two more functions as __init

Magnus Damm <[email protected]> writes:

> i386: mark two more functions as __init
>
> cyrix_identify() should be __init because transmeta_identify() is.
> tsc_init() is only called from setup_arch() which is marked as __init.
>
> These two section mismatches have been detected using running modpost on
> a vmlinux image compiled with CONFIG_RELOCATABLE=y.

I queued both patches (topology and this one)

-Andi

2006-08-08 19:58:08

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] i386: mark two more functions as __init

On Tue, 8 Aug 2006 17:17:00 +0900 (JST)
Magnus Damm <[email protected]> wrote:

> i386: mark two more functions as __init
>
> cyrix_identify() should be __init because transmeta_identify() is.
> tsc_init() is only called from setup_arch() which is marked as __init.
>
> These two section mismatches have been detected using running modpost on
> a vmlinux image compiled with CONFIG_RELOCATABLE=y.
>
> -static void cyrix_identify(struct cpuinfo_x86 * c)
> +static void __init cyrix_identify(struct cpuinfo_x86 * c)

Are we sure? We end up putting a pointer to this into
arch/i386/kernel/cpu/common.c:cpu_devs[], and that gets used from __cpuinit
code.

2006-08-09 00:14:28

by Magnus Damm

[permalink] [raw]
Subject: Re: [PATCH] i386: mark two more functions as __init

On 8/9/06, Andrew Morton <[email protected]> wrote:
> On Tue, 8 Aug 2006 17:17:00 +0900 (JST)
> Magnus Damm <[email protected]> wrote:
>
> > i386: mark two more functions as __init
> >
> > cyrix_identify() should be __init because transmeta_identify() is.
> > tsc_init() is only called from setup_arch() which is marked as __init.
> >
> > These two section mismatches have been detected using running modpost on
> > a vmlinux image compiled with CONFIG_RELOCATABLE=y.
> >
> > -static void cyrix_identify(struct cpuinfo_x86 * c)
> > +static void __init cyrix_identify(struct cpuinfo_x86 * c)
>
> Are we sure? We end up putting a pointer to this into
> arch/i386/kernel/cpu/common.c:cpu_devs[], and that gets used from __cpuinit
> code.

Uh, right. The problem is that almost all cpu code is put in the
__init section today. I'll break out and resend the tsc code, and on
top of that post a set of patches that puts cpu code and data into
__cpuinit and __cpuinitdata sections.

Thanks!

/ magnus