xen: x86: make init_intel_cacheinfo() void.
PATCH 1/1 xen: x86: make init_intel_cacheinfo() void.
It seems that we took this code from Linux, back when the function was 'unsigned int' and the return value was used.
But we are currently not doing anything with such value, so let's get rid of it and make the function void. As an anecdote, that's pretty much the same that happened in Linux as, since commit 807e9bc8e2fe6 ("x86/CPU:
Move cpu_detect_cache_sizes() into init_intel_cacheinfo()") the function is void there too.
---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: "Roger Pau Monné" <[email protected]>
--- xen/arch/x86/cpu/intel.c | 4 +--- xen/arch/x86/cpu/intel_cacheinfo.c | 4 +--- xen/include/asm-x86/processor.h | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-)
xen/arch/x86/cpu/intel.c +1 -3
@@ -346,12 +346,10 @@ static int num_cpu_cores(struct cpuinfo_x86 *c)static void init_intel (struct cpuinfo_x86 *c) { -unsigned int l2 =0 ; -/* Detect the extended topology information if available */ detect_extended_topology (c); - l2 =init_intel_cacheinfo (c); +init_intel_cacheinfo (c);if (c->cpuid_level >9 ) {unsigned eax =cpuid_eax (10 );/* Check for version and the number of counters */
xen/arch/x86/cpu/intel_cacheinfo.c +1 -3
@@ -116,7 +116,7 @@ static int find_num_cache_leaves(void)return i; } -unsigned int init_intel_cacheinfo (struct cpuinfo_x86 *c) +void init_intel_cacheinfo (struct cpuinfo_x86 *c) {unsigned int trace =0 , l1i =0 , l1d =0 , l2 =0 , l3 =0 ;/* Cache sizes */ unsigned int new_l1d =0 , new_l1i =0 ;/* Cache sizes from cpuid(4) */
@@ -262,6 +262,4 @@ unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c) } c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d)); - -return l2; }
xen/include/asm-x86/processor.h +1 -1
@@ -166,7 +166,7 @@ extern void identify_cpu(struct cpuinfo_x86 *);extern void setup_clear_cpu_cap (unsigned int );extern void setup_force_cpu_cap (unsigned int );extern void print_cpu_info (unsigned int cpu); -extern unsigned int init_intel_cacheinfo (struct cpuinfo_x86 *c); +extern void init_intel_cacheinfo (struct cpuinfo_x86 *c);#define cpu_to_core (_cpu) (cpu_data[_cpu].cpu_core_id)#define cpu_to_socket (_cpu) (cpu_data[_cpu].phys_proc_id)
Quoted 10 lines · Dario Faggioli
It seems that we took this code from Linux, back when the function was 'unsigned int' and the return value was used.
But we are currently not doing anything with such value, so let's get rid of it and make the function void. As an anecdote, that's pretty much the same that happened in Linux as, since commit
807e9bc8e2fe6("x86/CPU:
Movecpu_detect_cache_sizes()intoinit_intel_cacheinfo()") the function is void there too.Signed-off-by Dario Faggioli <[email protected]>
Furthermore, Shanghai already uses this in its form.