x86: little clean up of intel.c/intel_64.c
authorYinghai Lu <yhlu.kernel@gmail.com>
Mon, 8 Sep 2008 00:58:58 +0000 (17:58 -0700)
committerIngo Molnar <mingo@elte.hu>
Mon, 8 Sep 2008 13:46:03 +0000 (15:46 +0200)
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/cpu/intel_64.c

index 959417b8cd6462e00fde46a4d13d863510c0bd0f..4a8ac9d4ff50e9a5eb1465921ec9b4f33865c8ad 100644 (file)
@@ -76,7 +76,7 @@ static void __cpuinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
 /*
  * find out the number of processor cores on the die
  */
-static int __cpuinit num_cpu_cores(struct cpuinfo_x86 *c)
+static int __cpuinit intel_num_cpu_cores(struct cpuinfo_x86 *c)
 {
        unsigned int eax, ebx, ecx, edx;
 
@@ -183,7 +183,7 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
                 * let's use the legacy cpuid vector 0x1 and 0x4 for topology
                 * detection.
                 */
-               c->x86_max_cores = num_cpu_cores(c);
+               c->x86_max_cores = intel_num_cpu_cores(c);
                detect_ht(c);
        }
 
@@ -210,9 +210,8 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
 
        if (cpu_has_xmm2)
                set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
-       if (c->x86 == 15) {
+       if (c->x86 == 15)
                set_cpu_cap(c, X86_FEATURE_P4);
-       }
        if (c->x86 == 6)
                set_cpu_cap(c, X86_FEATURE_P3);
        if (cpu_has_ds) {
index 14a2cd98d4801b910b0721c8b4ed29c2edb2c150..aef4f2826313120d4771cc7516cf60ede564fc09 100644 (file)
@@ -71,17 +71,15 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
                        set_cpu_cap(c, X86_FEATURE_BTS);
                if (!(l1 & (1<<12)))
                        set_cpu_cap(c, X86_FEATURE_PEBS);
-       }
-
-
-       if (cpu_has_bts)
                ds_init_intel(c);
+       }
 
        if (c->x86 == 15)
                c->x86_cache_alignment = c->x86_clflush_size * 2;
        if (c->x86 == 6)
                set_cpu_cap(c, X86_FEATURE_REP_GOOD);
-       set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
+       if (cpu_has_xmm2)
+               set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
 
        detect_extended_topology(c);
        if (!cpu_has(c, X86_FEATURE_XTOPOLOGY))