Skip to content

Commit

Permalink
x86: remove duplicated get_model_name() calling
Browse files Browse the repository at this point in the history
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Sep 6, 2008
1 parent deed05b commit 1b05d60
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 15 deletions.
3 changes: 0 additions & 3 deletions arch/x86/kernel/cpu/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
{
u32 l, h;
int mbytes = num_physpages >> (20-PAGE_SHIFT);
int r;

#ifdef CONFIG_SMP
unsigned long long value;
Expand Down Expand Up @@ -75,8 +74,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
*/
clear_cpu_cap(c, 0*32+31);

r = get_model_name(c);

switch (c->x86) {
case 4:
/*
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/kernel/cpu/amd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
if (c->x86 >= 6)
set_cpu_cap(c, X86_FEATURE_FXSAVE_LEAK);

level = get_model_name(c);
if (!level) {
if (!c->x86_model_id[0]) {
switch (c->x86) {
case 0xf:
/* Should distinguish Models here, but this is only
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/cpu/centaur.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
if (c->x86_model >= 6 && c->x86_model < 9)
set_cpu_cap(c, X86_FEATURE_3DNOW);

get_model_name(c);
display_cacheinfo(c);
}

Expand Down
9 changes: 3 additions & 6 deletions arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,13 @@ static struct cpu_dev __cpuinitdata default_cpu = {
.c_x86_vendor = X86_VENDOR_UNKNOWN,
};

int __cpuinit get_model_name(struct cpuinfo_x86 *c)
static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
{
unsigned int *v;
char *p, *q;

if (c->extended_cpuid_level < 0x80000004)
return 0;
return;

v = (unsigned int *) c->x86_model_id;
cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]);
Expand All @@ -277,8 +277,6 @@ int __cpuinit get_model_name(struct cpuinfo_x86 *c)
while (q <= &c->x86_model_id[48])
*q++ = '\0'; /* Zero-pad the rest */
}

return 1;
}

void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
Expand Down Expand Up @@ -610,8 +608,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
#endif
}

if (c->extended_cpuid_level >= 0x80000004)
get_model_name(c); /* Default name */
get_model_name(c); /* Default name */

init_scattered_cpuid_features(c);
detect_nopl(c);
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/cpu/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ struct cpu_dev {

extern struct cpu_dev *__x86_cpu_dev_start[], *__x86_cpu_dev_end[];

extern int get_model_name(struct cpuinfo_x86 *c);
extern void display_cacheinfo(struct cpuinfo_x86 *c);

#endif
1 change: 0 additions & 1 deletion arch/x86/kernel/cpu/cyrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
*/
if ((0x30 <= dir1 && dir1 <= 0x6f) || (0x80 <= dir1 && dir1 <= 0x8f))
geode_configure();
get_model_name(c); /* get CPU marketing name */
return;
} else { /* MediaGX */
Cx86_cb[2] = (dir0_lsn & 1) ? '3' : '4';
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/cpu/transmeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
unsigned int cpu_rev, cpu_freq = 0, cpu_flags, new_cpu_rev;
char cpu_info[65];

get_model_name(c); /* Same as AMD/Cyrix */
display_cacheinfo(c);

/* Print CMS and CPU revision */
Expand Down

0 comments on commit 1b05d60

Please sign in to comment.