aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-09-06 04:52:27 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-06 08:09:12 -0400
commit1b05d60d60e81c6594da8298107a05b506f01797 (patch)
treea2eac6aee48ec09045b7a1f6457646588767ae52 /arch/x86/kernel/cpu
parentdeed05b7c017e49473e8c386efba196410fd18b3 (diff)
x86: remove duplicated get_model_name() calling
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r--arch/x86/kernel/cpu/amd.c3
-rw-r--r--arch/x86/kernel/cpu/amd_64.c3
-rw-r--r--arch/x86/kernel/cpu/centaur.c1
-rw-r--r--arch/x86/kernel/cpu/common.c9
-rw-r--r--arch/x86/kernel/cpu/cpu.h1
-rw-r--r--arch/x86/kernel/cpu/cyrix.c1
-rw-r--r--arch/x86/kernel/cpu/transmeta.c1
7 files changed, 4 insertions, 15 deletions
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index d64ea6097ca7..e0ba2c7c5a18 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -42,7 +42,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
42{ 42{
43 u32 l, h; 43 u32 l, h;
44 int mbytes = num_physpages >> (20-PAGE_SHIFT); 44 int mbytes = num_physpages >> (20-PAGE_SHIFT);
45 int r;
46 45
47#ifdef CONFIG_SMP 46#ifdef CONFIG_SMP
48 unsigned long long value; 47 unsigned long long value;
@@ -75,8 +74,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
75 */ 74 */
76 clear_cpu_cap(c, 0*32+31); 75 clear_cpu_cap(c, 0*32+31);
77 76
78 r = get_model_name(c);
79
80 switch (c->x86) { 77 switch (c->x86) {
81 case 4: 78 case 4:
82 /* 79 /*
diff --git a/arch/x86/kernel/cpu/amd_64.c b/arch/x86/kernel/cpu/amd_64.c
index d1c721c0c49f..c5fbf7477ead 100644
--- a/arch/x86/kernel/cpu/amd_64.c
+++ b/arch/x86/kernel/cpu/amd_64.c
@@ -157,8 +157,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
157 if (c->x86 >= 6) 157 if (c->x86 >= 6)
158 set_cpu_cap(c, X86_FEATURE_FXSAVE_LEAK); 158 set_cpu_cap(c, X86_FEATURE_FXSAVE_LEAK);
159 159
160 level = get_model_name(c); 160 if (!c->x86_model_id[0]) {
161 if (!level) {
162 switch (c->x86) { 161 switch (c->x86) {
163 case 0xf: 162 case 0xf:
164 /* Should distinguish Models here, but this is only 163 /* Should distinguish Models here, but this is only
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index e5f6d89521bf..89bfdd9cacc6 100644
--- a/arch/x86/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
@@ -289,7 +289,6 @@ static void __cpuinit init_c3(struct cpuinfo_x86 *c)
289 if (c->x86_model >= 6 && c->x86_model < 9) 289 if (c->x86_model >= 6 && c->x86_model < 9)
290 set_cpu_cap(c, X86_FEATURE_3DNOW); 290 set_cpu_cap(c, X86_FEATURE_3DNOW);
291 291
292 get_model_name(c);
293 display_cacheinfo(c); 292 display_cacheinfo(c);
294} 293}
295 294
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 286c89a991bd..a8b9b7242428 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -252,13 +252,13 @@ static struct cpu_dev __cpuinitdata default_cpu = {
252 .c_x86_vendor = X86_VENDOR_UNKNOWN, 252 .c_x86_vendor = X86_VENDOR_UNKNOWN,
253}; 253};
254 254
255int __cpuinit get_model_name(struct cpuinfo_x86 *c) 255static void __cpuinit get_model_name(struct cpuinfo_x86 *c)
256{ 256{
257 unsigned int *v; 257 unsigned int *v;
258 char *p, *q; 258 char *p, *q;
259 259
260 if (c->extended_cpuid_level < 0x80000004) 260 if (c->extended_cpuid_level < 0x80000004)
261 return 0; 261 return;
262 262
263 v = (unsigned int *) c->x86_model_id; 263 v = (unsigned int *) c->x86_model_id;
264 cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]); 264 cpuid(0x80000002, &v[0], &v[1], &v[2], &v[3]);
@@ -277,8 +277,6 @@ int __cpuinit get_model_name(struct cpuinfo_x86 *c)
277 while (q <= &c->x86_model_id[48]) 277 while (q <= &c->x86_model_id[48])
278 *q++ = '\0'; /* Zero-pad the rest */ 278 *q++ = '\0'; /* Zero-pad the rest */
279 } 279 }
280
281 return 1;
282} 280}
283 281
284void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c) 282void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c)
@@ -610,8 +608,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
610#endif 608#endif
611 } 609 }
612 610
613 if (c->extended_cpuid_level >= 0x80000004) 611 get_model_name(c); /* Default name */
614 get_model_name(c); /* Default name */
615 612
616 init_scattered_cpuid_features(c); 613 init_scattered_cpuid_features(c);
617 detect_nopl(c); 614 detect_nopl(c);
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 3cc9d92afd8f..de4094a39210 100644
--- a/arch/x86/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
@@ -31,7 +31,6 @@ struct cpu_dev {
31 31
32extern struct cpu_dev *__x86_cpu_dev_start[], *__x86_cpu_dev_end[]; 32extern struct cpu_dev *__x86_cpu_dev_start[], *__x86_cpu_dev_end[];
33 33
34extern int get_model_name(struct cpuinfo_x86 *c);
35extern void display_cacheinfo(struct cpuinfo_x86 *c); 34extern void display_cacheinfo(struct cpuinfo_x86 *c);
36 35
37#endif 36#endif
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 3f8c7283d816..ffd0f5ed071a 100644
--- a/arch/x86/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
@@ -301,7 +301,6 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c)
301 */ 301 */
302 if ((0x30 <= dir1 && dir1 <= 0x6f) || (0x80 <= dir1 && dir1 <= 0x8f)) 302 if ((0x30 <= dir1 && dir1 <= 0x6f) || (0x80 <= dir1 && dir1 <= 0x8f))
303 geode_configure(); 303 geode_configure();
304 get_model_name(c); /* get CPU marketing name */
305 return; 304 return;
306 } else { /* MediaGX */ 305 } else { /* MediaGX */
307 Cx86_cb[2] = (dir0_lsn & 1) ? '3' : '4'; 306 Cx86_cb[2] = (dir0_lsn & 1) ? '3' : '4';
diff --git a/arch/x86/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index 7c46e6ecedca..738e03244f95 100644
--- a/arch/x86/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
@@ -12,7 +12,6 @@ static void __cpuinit init_transmeta(struct cpuinfo_x86 *c)
12 unsigned int cpu_rev, cpu_freq = 0, cpu_flags, new_cpu_rev; 12 unsigned int cpu_rev, cpu_freq = 0, cpu_flags, new_cpu_rev;
13 char cpu_info[65]; 13 char cpu_info[65];
14 14
15 get_model_name(c); /* Same as AMD/Cyrix */
16 display_cacheinfo(c); 15 display_cacheinfo(c);
17 16
18 /* Print CMS and CPU revision */ 17 /* Print CMS and CPU revision */