2006-08-09 01:02:12

by Magnus Damm

[permalink] [raw]
Subject: [PATCH 01/06] i386: mark cpu identify functions as __cpuinit

i386: mark cpu identify functions as __cpuinit

Mark i386-specific cpu identification functions as __cpuinit. They are all
only called from arch/i386/common.c:identify_cpu() that already is marked as
__cpuinit.

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

cyrix.c | 4 ++--
nexgen.c | 4 ++--
transmeta.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)

--- 0001/arch/i386/kernel/cpu/cyrix.c
+++ work/arch/i386/kernel/cpu/cyrix.c 2006-08-09 08:38:00.000000000 +0900
@@ -12,7 +12,7 @@
/*
* Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU
*/
-static void __init do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
+static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1)
{
unsigned char ccr2, ccr3;
unsigned long flags;
@@ -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 __cpuinit cyrix_identify(struct cpuinfo_x86 * c)
{
/* Detect Cyrix with disabled CPUID */
if ( c->x86 == 4 && test_cyrix_52div() ) {
--- 0001/arch/i386/kernel/cpu/nexgen.c
+++ work/arch/i386/kernel/cpu/nexgen.c 2006-08-09 08:37:02.000000000 +0900
@@ -10,7 +10,7 @@
* to have CPUID. (Thanks to Herbert Oppmann)
*/

-static int __init deep_magic_nexgen_probe(void)
+static int __cpuinit deep_magic_nexgen_probe(void)
{
int ret;

@@ -32,7 +32,7 @@ static void __init init_nexgen(struct cp
c->x86_cache_size = 256; /* A few had 1 MB... */
}

-static void __init nexgen_identify(struct cpuinfo_x86 * c)
+static void __cpuinit nexgen_identify(struct cpuinfo_x86 * c)
{
/* Detect NexGen with old hypercode */
if ( deep_magic_nexgen_probe() ) {
--- 0001/arch/i386/kernel/cpu/transmeta.c
+++ work/arch/i386/kernel/cpu/transmeta.c 2006-08-09 08:09:05.000000000 +0900
@@ -85,7 +85,7 @@ static void __init init_transmeta(struct
#endif
}

-static void __init transmeta_identify(struct cpuinfo_x86 * c)
+static void __cpuinit transmeta_identify(struct cpuinfo_x86 * c)
{
u32 xlvl;
generic_identify(c);


2006-08-09 01:02:32

by Magnus Damm

[permalink] [raw]
Subject: [PATCH 04/06] i386: mark cpu cache functions as __cpuinit

i386: mark cpu cache functions as __cpuinit

Mark i386-specific cpu cache functions as __cpuinit. They are all
only called from arch/i386/common.c:display_cache_info() that already is
marked as __cpuinit.

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

amd.c | 2 +-
centaur.c | 2 +-
intel.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

--- 0004/arch/i386/kernel/cpu/amd.c
+++ work/arch/i386/kernel/cpu/amd.c 2006-08-09 08:13:59.000000000 +0900
@@ -246,7 +246,7 @@ static void __cpuinit init_amd(struct cp
num_cache_leaves = 3;
}

-static unsigned int amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)
+static unsigned int __cpuinit amd_size_cache(struct cpuinfo_x86 * c, unsigned int size)
{
/* AMD errata T13 (order #21922) */
if ((c->x86 == 6)) {
--- 0004/arch/i386/kernel/cpu/centaur.c
+++ work/arch/i386/kernel/cpu/centaur.c 2006-08-09 08:14:28.000000000 +0900
@@ -442,7 +442,7 @@ static void __cpuinit init_centaur(struc
}
}

-static unsigned int centaur_size_cache(struct cpuinfo_x86 * c, unsigned int size)
+static unsigned int __cpuinit centaur_size_cache(struct cpuinfo_x86 * c, unsigned int size)
{
/* VIA C3 CPUs (670-68F) need further shifting. */
if ((c->x86 == 6) && ((c->x86_model == 7) || (c->x86_model == 8)))
--- 0003/arch/i386/kernel/cpu/intel.c
+++ work/arch/i386/kernel/cpu/intel.c 2006-08-09 08:14:47.000000000 +0900
@@ -198,7 +198,7 @@ static void __cpuinit init_intel(struct
}


-static unsigned int intel_size_cache(struct cpuinfo_x86 * c, unsigned int size)
+static unsigned int __cpuinit intel_size_cache(struct cpuinfo_x86 * c, unsigned int size)
{
/* Intel PIII Tualatin. This comes in two flavours.
* One has 256kb of cache, the other 512. We have no way

2006-08-09 01:02:17

by Magnus Damm

[permalink] [raw]
Subject: [PATCH 02/06] i386: remove redundant generic_identify() calls when identifying cpus

i386: remove redundant generic_identify() calls when identifying cpus

cpu_dev->c_identify is only called from arch/i386/common.c:identify_cpu(), and
this after generic_identify() already has been called. There is no need to call
this function twice and hook it in c_identify - but I may be wrong, please
double check before applying.

This patch also removes generic_identify() from cpu.h to avoid unnecessary
future nesting.

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

amd.c | 1 -
common.c | 2 +-
cpu.h | 2 --
cyrix.c | 2 --
intel.c | 1 -
nexgen.c | 1 -
transmeta.c | 1 -
7 files changed, 1 insertion(+), 9 deletions(-)

--- 0001/arch/i386/kernel/cpu/amd.c
+++ work/arch/i386/kernel/cpu/amd.c 2006-08-09 07:51:46.000000000 +0900
@@ -275,7 +275,6 @@ static struct cpu_dev amd_cpu_dev __init
},
},
.c_init = init_amd,
- .c_identify = generic_identify,
.c_size_cache = amd_size_cache,
};

--- 0001/arch/i386/kernel/cpu/common.c
+++ work/arch/i386/kernel/cpu/common.c 2006-08-09 08:06:33.000000000 +0900
@@ -265,7 +265,7 @@ static void __init early_cpu_detect(void
}
}

-void __cpuinit generic_identify(struct cpuinfo_x86 * c)
+static void __cpuinit generic_identify(struct cpuinfo_x86 * c)
{
u32 tfms, xlvl;
int ebx;
--- 0001/arch/i386/kernel/cpu/cpu.h
+++ work/arch/i386/kernel/cpu/cpu.h 2006-08-09 07:52:07.000000000 +0900
@@ -24,7 +24,5 @@ extern struct cpu_dev * cpu_devs [X86_VE
extern int get_model_name(struct cpuinfo_x86 *c);
extern void display_cacheinfo(struct cpuinfo_x86 *c);

-extern void generic_identify(struct cpuinfo_x86 * c);
-
extern void early_intel_workaround(struct cpuinfo_x86 *c);

--- 0004/arch/i386/kernel/cpu/cyrix.c
+++ work/arch/i386/kernel/cpu/cyrix.c 2006-08-09 08:04:46.000000000 +0900
@@ -427,7 +427,6 @@ static void __cpuinit cyrix_identify(str
local_irq_restore(flags);
}
}
- generic_identify(c);
}

static struct cpu_dev cyrix_cpu_dev __initdata = {
@@ -457,7 +456,6 @@ static struct cpu_dev nsc_cpu_dev __init
.c_vendor = "NSC",
.c_ident = { "Geode by NSC" },
.c_init = init_nsc,
- .c_identify = generic_identify,
};

int __init nsc_init_cpu(void)
--- 0001/arch/i386/kernel/cpu/intel.c
+++ work/arch/i386/kernel/cpu/intel.c 2006-08-09 07:51:40.000000000 +0900
@@ -263,7 +263,6 @@ static struct cpu_dev intel_cpu_dev __cp
},
},
.c_init = init_intel,
- .c_identify = generic_identify,
.c_size_cache = intel_size_cache,
};

--- 0004/arch/i386/kernel/cpu/nexgen.c
+++ work/arch/i386/kernel/cpu/nexgen.c 2006-08-09 07:52:47.000000000 +0900
@@ -38,7 +38,6 @@ static void __cpuinit nexgen_identify(st
if ( deep_magic_nexgen_probe() ) {
strcpy(c->x86_vendor_id, "NexGenDriven");
}
- generic_identify(c);
}

static struct cpu_dev nexgen_cpu_dev __initdata = {
--- 0004/arch/i386/kernel/cpu/transmeta.c
+++ work/arch/i386/kernel/cpu/transmeta.c 2006-08-09 07:53:37.000000000 +0900
@@ -88,7 +88,6 @@ static void __init init_transmeta(struct
static void __cpuinit transmeta_identify(struct cpuinfo_x86 * c)
{
u32 xlvl;
- generic_identify(c);

/* Transmeta-defined flags: level 0x80860001 */
xlvl = cpuid_eax(0x80860000);

2006-08-09 01:02:50

by Magnus Damm

[permalink] [raw]
Subject: [PATCH 05/06] i386: mark cpu_dev structures as __cpuinitdata

i386: mark cpu_dev structures as __cpuinitdata

The different cpu_dev structures are all used from __cpuinit callers what
I can tell. So mark them as __cpuinitdata instead of __initdata. I am a
little bit unsure about arch/i386/common.c:default_cpu, especially when it
comes to the purpose of this_cpu.

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

amd.c | 2 +-
centaur.c | 2 +-
common.c | 2 +-
cyrix.c | 4 ++--
nexgen.c | 2 +-
rise.c | 2 +-
transmeta.c | 2 +-
umc.c | 2 +-
8 files changed, 9 insertions(+), 9 deletions(-)

--- 0005/arch/i386/kernel/cpu/amd.c
+++ work/arch/i386/kernel/cpu/amd.c 2006-08-09 08:33:02.000000000 +0900
@@ -259,7 +259,7 @@ static unsigned int __cpuinit amd_size_c
return size;
}

-static struct cpu_dev amd_cpu_dev __initdata = {
+static struct cpu_dev amd_cpu_dev __cpuinitdata = {
.c_vendor = "AMD",
.c_ident = { "AuthenticAMD" },
.c_models = {
--- 0005/arch/i386/kernel/cpu/centaur.c
+++ work/arch/i386/kernel/cpu/centaur.c 2006-08-09 08:33:02.000000000 +0900
@@ -457,7 +457,7 @@ static unsigned int __cpuinit centaur_si
return size;
}

-static struct cpu_dev centaur_cpu_dev __initdata = {
+static struct cpu_dev centaur_cpu_dev __cpuinitdata = {
.c_vendor = "Centaur",
.c_ident = { "CentaurHauls" },
.c_init = init_centaur,
--- 0004/arch/i386/kernel/cpu/common.c
+++ work/arch/i386/kernel/cpu/common.c 2006-08-09 08:33:02.000000000 +0900
@@ -49,7 +49,7 @@ static void __cpuinit default_init(struc
}
}

-static struct cpu_dev default_cpu = {
+static struct cpu_dev __cpuinitdata default_cpu = {
.c_init = default_init,
.c_vendor = "Unknown",
};
--- 0004/arch/i386/kernel/cpu/cyrix.c
+++ work/arch/i386/kernel/cpu/cyrix.c 2006-08-09 08:33:02.000000000 +0900
@@ -429,7 +429,7 @@ static void __cpuinit cyrix_identify(str
}
}

-static struct cpu_dev cyrix_cpu_dev __initdata = {
+static struct cpu_dev cyrix_cpu_dev __cpuinitdata = {
.c_vendor = "Cyrix",
.c_ident = { "CyrixInstead" },
.c_init = init_cyrix,
@@ -452,7 +452,7 @@ static int __init cyrix_exit_cpu(void)

late_initcall(cyrix_exit_cpu);

-static struct cpu_dev nsc_cpu_dev __initdata = {
+static struct cpu_dev nsc_cpu_dev __cpuinitdata = {
.c_vendor = "NSC",
.c_ident = { "Geode by NSC" },
.c_init = init_nsc,
--- 0004/arch/i386/kernel/cpu/nexgen.c
+++ work/arch/i386/kernel/cpu/nexgen.c 2006-08-09 08:33:02.000000000 +0900
@@ -40,7 +40,7 @@ static void __cpuinit nexgen_identify(st
}
}

-static struct cpu_dev nexgen_cpu_dev __initdata = {
+static struct cpu_dev nexgen_cpu_dev __cpuinitdata = {
.c_vendor = "Nexgen",
.c_ident = { "NexGenDriven" },
.c_models = {
--- 0004/arch/i386/kernel/cpu/rise.c
+++ work/arch/i386/kernel/cpu/rise.c 2006-08-09 08:33:02.000000000 +0900
@@ -28,7 +28,7 @@ static void __cpuinit init_rise(struct c
set_bit(X86_FEATURE_CX8, c->x86_capability);
}

-static struct cpu_dev rise_cpu_dev __initdata = {
+static struct cpu_dev rise_cpu_dev __cpuinitdata = {
.c_vendor = "Rise",
.c_ident = { "RiseRiseRise" },
.c_models = {
--- 0004/arch/i386/kernel/cpu/transmeta.c
+++ work/arch/i386/kernel/cpu/transmeta.c 2006-08-09 08:34:32.000000000 +0900
@@ -97,7 +97,7 @@ static void __cpuinit transmeta_identify
}
}

-static struct cpu_dev transmeta_cpu_dev __initdata = {
+static struct cpu_dev transmeta_cpu_dev __cpuinitdata = {
.c_vendor = "Transmeta",
.c_ident = { "GenuineTMx86", "TransmetaCPU" },
.c_init = init_transmeta,
--- 0004/arch/i386/kernel/cpu/umc.c
+++ work/arch/i386/kernel/cpu/umc.c 2006-08-09 08:33:02.000000000 +0900
@@ -5,7 +5,7 @@

/* UMC chips appear to be only either 386 or 486, so no special init takes place.
*/
-static struct cpu_dev umc_cpu_dev __initdata = {
+static struct cpu_dev umc_cpu_dev __cpuinitdata = {
.c_vendor = "UMC",
.c_ident = { "UMC UMC UMC" },
.c_models = {

2006-08-09 01:02:56

by Magnus Damm

[permalink] [raw]
Subject: [PATCH 06/06] x86_64: mark init_amd() as __cpuinit

x86_64: mark init_amd() as __cpuinit

The init_amd() function is only called from identify_cpu() which is already
marked as __cpuinit. So let's mark it as __cpuinit.

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

setup.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/x86_64/kernel/setup.c
+++ work/arch/x86_64/kernel/setup.c 2006-08-09 08:17:41.000000000 +0900
@@ -833,7 +833,7 @@ static void __init amd_detect_cmp(struct
#endif
}

-static void __init init_amd(struct cpuinfo_x86 *c)
+static void __cpuinit init_amd(struct cpuinfo_x86 *c)
{
unsigned level;

2006-08-09 01:02:50

by Magnus Damm

[permalink] [raw]
Subject: [PATCH 03/06] i386: mark cpu init functions as __cpuinit, data as __cpuinitdata

i386: mark cpu init functions as __cpuinit, data as __cpuinitdata

Mark i386-specific cpu init functions as __cpuinit. They are all
only called from arch/i386/common.c:identify_cpu() that already is marked as
__cpuinit. This patch also removes the empty function init_umc().

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

amd.c | 2 +-
centaur.c | 20 ++++++++++----------
common.c | 2 +-
cyrix.c | 32 ++++++++++++++++----------------
nexgen.c | 2 +-
rise.c | 2 +-
transmeta.c | 2 +-
umc.c | 6 ------
8 files changed, 31 insertions(+), 37 deletions(-)

--- 0003/arch/i386/kernel/cpu/amd.c
+++ work/arch/i386/kernel/cpu/amd.c 2006-08-09 08:53:37.000000000 +0900
@@ -22,7 +22,7 @@
extern void vide(void);
__asm__(".align 4\nvide: ret");

-static void __init init_amd(struct cpuinfo_x86 *c)
+static void __cpuinit init_amd(struct cpuinfo_x86 *c)
{
u32 l, h;
int mbytes = num_physpages >> (20-PAGE_SHIFT);
--- 0001/arch/i386/kernel/cpu/centaur.c
+++ work/arch/i386/kernel/cpu/centaur.c 2006-08-09 08:53:37.000000000 +0900
@@ -9,7 +9,7 @@

#ifdef CONFIG_X86_OOSTORE

-static u32 __init power2(u32 x)
+static u32 __cpuinit power2(u32 x)
{
u32 s=1;
while(s<=x)
@@ -22,7 +22,7 @@ static u32 __init power2(u32 x)
* Set up an actual MCR
*/

-static void __init centaur_mcr_insert(int reg, u32 base, u32 size, int key)
+static void __cpuinit centaur_mcr_insert(int reg, u32 base, u32 size, int key)
{
u32 lo, hi;

@@ -40,7 +40,7 @@ static void __init centaur_mcr_insert(in
* Shortcut: We know you can't put 4Gig of RAM on a winchip
*/

-static u32 __init ramtop(void) /* 16388 */
+static u32 __cpuinit ramtop(void) /* 16388 */
{
int i;
u32 top = 0;
@@ -91,7 +91,7 @@ static u32 __init ramtop(void) /* 16388
* Compute a set of MCR's to give maximum coverage
*/

-static int __init centaur_mcr_compute(int nr, int key)
+static int __cpuinit centaur_mcr_compute(int nr, int key)
{
u32 mem = ramtop();
u32 root = power2(mem);
@@ -166,7 +166,7 @@ static int __init centaur_mcr_compute(in
return ct;
}

-static void __init centaur_create_optimal_mcr(void)
+static void __cpuinit centaur_create_optimal_mcr(void)
{
int i;
/*
@@ -189,7 +189,7 @@ static void __init centaur_create_optima
wrmsr(MSR_IDT_MCR0+i, 0, 0);
}

-static void __init winchip2_create_optimal_mcr(void)
+static void __cpuinit winchip2_create_optimal_mcr(void)
{
u32 lo, hi;
int i;
@@ -227,7 +227,7 @@ static void __init winchip2_create_optim
* Handle the MCR key on the Winchip 2.
*/

-static void __init winchip2_unprotect_mcr(void)
+static void __cpuinit winchip2_unprotect_mcr(void)
{
u32 lo, hi;
u32 key;
@@ -239,7 +239,7 @@ static void __init winchip2_unprotect_mc
wrmsr(MSR_IDT_MCR_CTRL, lo, hi);
}

-static void __init winchip2_protect_mcr(void)
+static void __cpuinit winchip2_protect_mcr(void)
{
u32 lo, hi;

@@ -257,7 +257,7 @@ static void __init winchip2_protect_mcr(
#define RNG_ENABLED (1 << 3)
#define RNG_ENABLE (1 << 6) /* MSR_VIA_RNG */

-static void __init init_c3(struct cpuinfo_x86 *c)
+static void __cpuinit init_c3(struct cpuinfo_x86 *c)
{
u32 lo, hi;

@@ -303,7 +303,7 @@ static void __init init_c3(struct cpuinf
display_cacheinfo(c);
}

-static void __init init_centaur(struct cpuinfo_x86 *c)
+static void __cpuinit init_centaur(struct cpuinfo_x86 *c)
{
enum {
ECX8=1<<1,
--- 0003/arch/i386/kernel/cpu/common.c
+++ work/arch/i386/kernel/cpu/common.c 2006-08-09 08:53:37.000000000 +0900
@@ -36,7 +36,7 @@ struct cpu_dev * cpu_devs[X86_VENDOR_NUM

extern int disable_pse;

-static void default_init(struct cpuinfo_x86 * c)
+static void __cpuinit default_init(struct cpuinfo_x86 * c)
{
/* Not much we can do here... */
/* Check if at least it has cpuid */
--- 0003/arch/i386/kernel/cpu/cyrix.c
+++ work/arch/i386/kernel/cpu/cyrix.c 2006-08-09 08:55:57.000000000 +0900
@@ -52,25 +52,25 @@ static void __cpuinit do_cyrix_devid(uns
* Actually since bugs.h doesn't even reference this perhaps someone should
* fix the documentation ???
*/
-static unsigned char Cx86_dir0_msb __initdata = 0;
+static unsigned char Cx86_dir0_msb __cpuinitdata = 0;

-static char Cx86_model[][9] __initdata = {
+static char Cx86_model[][9] __cpuinitdata = {
"Cx486", "Cx486", "5x86 ", "6x86", "MediaGX ", "6x86MX ",
"M II ", "Unknown"
};
-static char Cx486_name[][5] __initdata = {
+static char Cx486_name[][5] __cpuinitdata = {
"SLC", "DLC", "SLC2", "DLC2", "SRx", "DRx",
"SRx2", "DRx2"
};
-static char Cx486S_name[][4] __initdata = {
+static char Cx486S_name[][4] __cpuinitdata = {
"S", "S2", "Se", "S2e"
};
-static char Cx486D_name[][4] __initdata = {
+static char Cx486D_name[][4] __cpuinitdata = {
"DX", "DX2", "?", "?", "?", "DX4"
};
-static char Cx86_cb[] __initdata = "?.5x Core/Bus Clock";
-static char cyrix_model_mult1[] __initdata = "12??43";
-static char cyrix_model_mult2[] __initdata = "12233445";
+static char Cx86_cb[] __cpuinitdata = "?.5x Core/Bus Clock";
+static char cyrix_model_mult1[] __cpuinitdata = "12??43";
+static char cyrix_model_mult2[] __cpuinitdata = "12233445";

/*
* Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old
@@ -82,7 +82,7 @@ static char cyrix_model_mult2[] __initda

extern void calibrate_delay(void) __init;

-static void __init check_cx686_slop(struct cpuinfo_x86 *c)
+static void __cpuinit check_cx686_slop(struct cpuinfo_x86 *c)
{
unsigned long flags;

@@ -107,7 +107,7 @@ static void __init check_cx686_slop(stru
}


-static void __init set_cx86_reorder(void)
+static void __cpuinit set_cx86_reorder(void)
{
u8 ccr3;

@@ -122,7 +122,7 @@ static void __init set_cx86_reorder(void
setCx86(CX86_CCR3, ccr3);
}

-static void __init set_cx86_memwb(void)
+static void __cpuinit set_cx86_memwb(void)
{
u32 cr0;

@@ -137,7 +137,7 @@ static void __init set_cx86_memwb(void)
setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14 );
}

-static void __init set_cx86_inc(void)
+static void __cpuinit set_cx86_inc(void)
{
unsigned char ccr3;

@@ -158,7 +158,7 @@ static void __init set_cx86_inc(void)
* Configure later MediaGX and/or Geode processor.
*/

-static void __init geode_configure(void)
+static void __cpuinit geode_configure(void)
{
unsigned long flags;
u8 ccr3, ccr4;
@@ -184,14 +184,14 @@ static void __init geode_configure(void)


#ifdef CONFIG_PCI
-static struct pci_device_id __initdata cyrix_55x0[] = {
+static struct pci_device_id __cpuinitdata cyrix_55x0[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510) },
{ PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520) },
{ },
};
#endif

-static void __init init_cyrix(struct cpuinfo_x86 *c)
+static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
{
unsigned char dir0, dir0_msn, dir0_lsn, dir1 = 0;
char *buf = c->x86_model_id;
@@ -346,7 +346,7 @@ static void __init init_cyrix(struct cpu
/*
* Handle National Semiconductor branded processors
*/
-static void __init init_nsc(struct cpuinfo_x86 *c)
+static void __cpuinit init_nsc(struct cpuinfo_x86 *c)
{
/* There may be GX1 processors in the wild that are branded
* NSC and not Cyrix.
--- 0003/arch/i386/kernel/cpu/nexgen.c
+++ work/arch/i386/kernel/cpu/nexgen.c 2006-08-09 08:53:37.000000000 +0900
@@ -27,7 +27,7 @@ static int __cpuinit deep_magic_nexgen_p
return ret;
}

-static void __init init_nexgen(struct cpuinfo_x86 * c)
+static void __cpuinit init_nexgen(struct cpuinfo_x86 * c)
{
c->x86_cache_size = 256; /* A few had 1 MB... */
}
--- 0001/arch/i386/kernel/cpu/rise.c
+++ work/arch/i386/kernel/cpu/rise.c 2006-08-09 08:53:37.000000000 +0900
@@ -5,7 +5,7 @@

#include "cpu.h"

-static void __init init_rise(struct cpuinfo_x86 *c)
+static void __cpuinit init_rise(struct cpuinfo_x86 *c)
{
printk("CPU: Rise iDragon");
if (c->x86_model > 2)
--- 0003/arch/i386/kernel/cpu/transmeta.c
+++ work/arch/i386/kernel/cpu/transmeta.c 2006-08-09 08:53:37.000000000 +0900
@@ -5,7 +5,7 @@
#include <asm/msr.h>
#include "cpu.h"

-static void __init init_transmeta(struct cpuinfo_x86 *c)
+static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
{
unsigned int cap_mask, uk, max, dummy;
unsigned int cms_rev1, cms_rev2;
--- 0001/arch/i386/kernel/cpu/umc.c
+++ work/arch/i386/kernel/cpu/umc.c 2006-08-09 08:53:37.000000000 +0900
@@ -5,11 +5,6 @@

/* UMC chips appear to be only either 386 or 486, so no special init takes place.
*/
-static void __init init_umc(struct cpuinfo_x86 * c)
-{
-
-}
-
static struct cpu_dev umc_cpu_dev __initdata = {
.c_vendor = "UMC",
.c_ident = { "UMC UMC UMC" },
@@ -21,7 +16,6 @@ static struct cpu_dev umc_cpu_dev __init
}
},
},
- .c_init = init_umc,
};

int __init umc_init_cpu(void)

2006-08-09 01:03:31

by Magnus Damm

[permalink] [raw]
Subject: [PATCH] i386: mark tsc_init() as __init

i386: mark tsc_init() as __init

tsc_init() is only called from setup_arch() which is marked as __init.

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

tsc.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

--- 0001/arch/i386/kernel/tsc.c
+++ work/arch/i386/kernel/tsc.c 2006-08-09 08:59:47.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-09 02:20:48

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH 06/06] x86_64: mark init_amd() as __cpuinit

On Wednesday 09 August 2006 03:03, Magnus Damm wrote:
> x86_64: mark init_amd() as __cpuinit
>
> The init_amd() function is only called from identify_cpu() which is already
> marked as __cpuinit. So let's mark it as __cpuinit.

I added all 6 patches. Thanks.
-Andi

2006-08-09 02:20:18

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH 02/06] i386: remove redundant generic_identify() calls when identifying cpus

On Wednesday 09 August 2006 03:03, Magnus Damm wrote:
> i386: remove redundant generic_identify() calls when identifying cpus
>
> cpu_dev->c_identify is only called from arch/i386/common.c:identify_cpu(), and
> this after generic_identify() already has been called. There is no need to call
> this function twice and hook it in c_identify - but I may be wrong, please
> double check before applying.
>
> This patch also removes generic_identify() from cpu.h to avoid unnecessary
> future nesting.

There are sometimes subtle interactions with this (e.g. with parameters
changing flags and then someone else overwriting them again)

But agreed it seems bogus to call it twice.

I guess the only way to find out how much it breaks is to merge it.

-Andi