x86/CPU: Move x86_cpuinfo::x86_max_cores assignment to detect_num_cpu_cores()
authorThomas Gleixner <tglx@linutronix.de>
Sun, 13 May 2018 09:43:53 +0000 (11:43 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 13 May 2018 14:14:24 +0000 (16:14 +0200)
No point to have it at the call sites.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/cpu/centaur.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/cpu.h
arch/x86/kernel/cpu/intel.c

index c265494234e63c9d3a219263c1df450ed7c982d3..14433ff5b8285f124805c8e47dec0d9b3cc19f0b 100644 (file)
@@ -161,7 +161,7 @@ static void init_centaur(struct cpuinfo_x86 *c)
 #endif
        early_init_centaur(c);
        init_intel_cacheinfo(c);
-       c->x86_max_cores = detect_num_cpu_cores(c);
+       detect_num_cpu_cores(c);
 #ifdef CONFIG_X86_32
        detect_ht(c);
 #endif
index 6993842e788cb71613550eafd663de6097a39f25..f2085d54c2c8d25ea55f38d55dc5ce262591703c 100644 (file)
@@ -584,18 +584,17 @@ static void get_model_name(struct cpuinfo_x86 *c)
        *(s + 1) = '\0';
 }
 
-int detect_num_cpu_cores(struct cpuinfo_x86 *c)
+void detect_num_cpu_cores(struct cpuinfo_x86 *c)
 {
        unsigned int eax, ebx, ecx, edx;
 
+       c->x86_max_cores = 1;
        if (!IS_ENABLED(CONFIG_SMP) || c->cpuid_level < 4)
-               return 1;
+               return;
 
        cpuid_count(4, 0, &eax, &ebx, &ecx, &edx);
        if (eax & 0x1f)
-               return (eax >> 26) + 1;
-       else
-               return 1;
+               c->x86_max_cores = (eax >> 26) + 1;
 }
 
 void cpu_detect_cache_sizes(struct cpuinfo_x86 *c)
index 49bf8a0801057d1f61331f17d33d87771d3b1593..295cb00a5ac5f650faf6cb846fd64c4fa1878650 100644 (file)
@@ -54,7 +54,7 @@ extern u32 get_scattered_cpuid_leaf(unsigned int level,
 extern void init_intel_cacheinfo(struct cpuinfo_x86 *c);
 extern void init_amd_cacheinfo(struct cpuinfo_x86 *c);
 
-extern int detect_num_cpu_cores(struct cpuinfo_x86 *c);
+extern void detect_num_cpu_cores(struct cpuinfo_x86 *c);
 extern int detect_extended_topology(struct cpuinfo_x86 *c);
 extern void detect_ht(struct cpuinfo_x86 *c);
 
index ca141d159be15805c25f9b996dbd21e1065bd296..6c414e2f3f5ccabc057932d355f5fbce7e6a096b 100644 (file)
@@ -651,7 +651,7 @@ static void init_intel(struct cpuinfo_x86 *c)
                 * let's use the legacy cpuid vector 0x1 and 0x4 for topology
                 * detection.
                 */
-               c->x86_max_cores = detect_num_cpu_cores(c);
+               detect_num_cpu_cores(c);
 #ifdef CONFIG_X86_32
                detect_ht(c);
 #endif