x86: don't call generic_identify() redundantly
PATCH 1/1 x86: don't call generic_identify() redundantly
Right before calling struct cpu_dev's ->c_identify, if non-NULL, identify_cpu() calls generic_identify(). Hence there's no point for ->c_identify to point to generic_identify, nor for the handler to call that function. After removing all pointless uses, the function isn't being used outside the file that's defininig it anymore, and hence can become static.
xen/arch/x86/cpu/amd.c +0 -1
@@ -516,7 +516,6 @@ static struct cpu_dev amd_cpu_dev __cpui .c_vendor = "AMD", .c_ident = { "AuthenticAMD" }, .c_init = init_amd, - .c_identify = generic_identify, };int __init amd_init_cpu (void )
xen/arch/x86/cpu/common.c +1 -1
@@ -227,7 +227,7 @@ static void __init early_cpu_detect(void c->x86_capability[4 ] = cap4; } -void __cpuinit generic_identify (struct cpuinfo_x86 * c) +static void __cpuinit generic_identify (struct cpuinfo_x86 *c) {u32 tfms, xlvl, capability, excap, ebx;
xen/arch/x86/cpu/cpu.h +0 -2
@@ -28,6 +28,4 @@ extern unsigned int opt_cpuid_mask_ext_eextern int get_model_name (struct cpuinfo_x86 *c);extern void display_cacheinfo (struct cpuinfo_x86 *c); -extern void generic_identify (struct cpuinfo_x86 * c); -extern void early_intel_workaround (struct cpuinfo_x86 *c);
xen/arch/x86/cpu/cyrix.c +0 -2
@@ -288,7 +288,6 @@ static struct cpu_dev cyrix_cpu_dev __cp .c_vendor = "Cyrix", .c_ident = { "CyrixInstead" }, .c_init = init_cyrix, - .c_identify = generic_identify, };int __init cyrix_init_cpu (void )
@@ -303,7 +302,6 @@ static struct cpu_dev nsc_cpu_dev __cpui .c_vendor = "NSC", .c_ident = { "Geode by NSC" }, .c_init = init_cyrix, - .c_identify = generic_identify, };int __init nsc_init_cpu (void )
xen/arch/x86/cpu/intel.c +0 -1
@@ -329,7 +329,6 @@ static struct cpu_dev intel_cpu_dev __cp }, }, .c_init = init_intel, - .c_identify = generic_identify, .c_size_cache = intel_size_cache, };
xen/arch/x86/cpu/transmeta.c +0 -1
@@ -82,7 +82,6 @@ static void __init init_transmeta(structstatic void transmeta_identify (struct cpuinfo_x86 * c) {u32 xlvl; -generic_identify (c);/* Transmeta-defined flags: level 0x80860001 */ xlvl =cpuid_eax (0x80860000 );
x86: don't call generic_identify() redundantly
Right before calling struct cpu_dev's ->c_identify, if non-NULL, identify_cpu() calls generic_identify(). Hence there's no point for ->c_identify to point to generic_identify, nor for the handler to call that function. After removing all pointless uses, the function isn't being used outside the file that's defininig it anymore, and hence can become static.
xen/arch/x86/cpu/amd.c +0 -1
@@ -516,7 +516,6 @@ static struct cpu_dev amd_cpu_dev __cpui .c_vendor = "AMD", .c_ident = { "AuthenticAMD" }, .c_init = init_amd, - .c_identify = generic_identify, };int __init amd_init_cpu (void )
xen/arch/x86/cpu/common.c +1 -1
@@ -227,7 +227,7 @@ static void __init early_cpu_detect(void c->x86_capability[4 ] = cap4; } -void __cpuinit generic_identify (struct cpuinfo_x86 * c) +static void __cpuinit generic_identify (struct cpuinfo_x86 *c) {u32 tfms, xlvl, capability, excap, ebx;
xen/arch/x86/cpu/cpu.h +0 -2
@@ -28,6 +28,4 @@ extern unsigned int opt_cpuid_mask_ext_eextern int get_model_name (struct cpuinfo_x86 *c);extern void display_cacheinfo (struct cpuinfo_x86 *c); -extern void generic_identify (struct cpuinfo_x86 * c); -extern void early_intel_workaround (struct cpuinfo_x86 *c);
xen/arch/x86/cpu/cyrix.c +0 -2
@@ -288,7 +288,6 @@ static struct cpu_dev cyrix_cpu_dev __cp .c_vendor = "Cyrix", .c_ident = { "CyrixInstead" }, .c_init = init_cyrix, - .c_identify = generic_identify, };int __init cyrix_init_cpu (void )
@@ -303,7 +302,6 @@ static struct cpu_dev nsc_cpu_dev __cpui .c_vendor = "NSC", .c_ident = { "Geode by NSC" }, .c_init = init_cyrix, - .c_identify = generic_identify, };int __init nsc_init_cpu (void )
xen/arch/x86/cpu/intel.c +0 -1
@@ -329,7 +329,6 @@ static struct cpu_dev intel_cpu_dev __cp }, }, .c_init = init_intel, - .c_identify = generic_identify, .c_size_cache = intel_size_cache, };
xen/arch/x86/cpu/transmeta.c +0 -1
@@ -82,7 +82,6 @@ static void __init init_transmeta(structstatic void transmeta_identify (struct cpuinfo_x86 * c) {u32 xlvl; -generic_identify (c);/* Transmeta-defined flags: level 0x80860001 */ xlvl =cpuid_eax (0x80860000 );
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 8 lines · Jan Beulich
Right before calling struct cpu_dev's ->c_identify, if non-NULL,
identify_cpu()callsgeneric_identify(). Hence there's no point for ->c_identify to point togeneric_identify, nor for the handler to call that function. After removing all pointless uses, the function isn't being used outside the file that's defininig it anymore, and hence can become static.Signed-off-by Jan Beulich <[email protected]>
Quoted 75 lines
xen/arch/x86/cpu/amd.c +0
-1@@ -516,7 +516,6 @@ static struct cpu_dev amd_cpu_dev __cpui .c_vendor = "AMD", .c_ident = { "AuthenticAMD" }, .c_init = init_amd, - .c_identify = generic_identify, };int __init amd_init_cpu (void )xen/arch/x86/cpu/common.c +1
-1@@ -227,7 +227,7 @@ static void __init early_cpu_detect(void c->x86_capability[4 ] = cap4; } -void __cpuinit generic_identify (struct cpuinfo_x86 * c) +static void __cpuinit generic_identify (struct cpuinfo_x86 *c) {u32 tfms, xlvl, capability, excap, ebx;xen/arch/x86/cpu/cpu.h +0
-2@@ -28,6 +28,4 @@ extern unsigned int opt_cpuid_mask_ext_eextern int get_model_name (struct cpuinfo_x86 *c);extern void display_cacheinfo (struct cpuinfo_x86 *c); -extern void generic_identify (struct cpuinfo_x86 * c); -extern void early_intel_workaround (struct cpuinfo_x86 *c);xen/arch/x86/cpu/cyrix.c +0
-2@@ -288,7 +288,6 @@ static struct cpu_dev cyrix_cpu_dev __cp .c_vendor = "Cyrix", .c_ident = { "CyrixInstead" }, .c_init = init_cyrix, - .c_identify = generic_identify, };int __init cyrix_init_cpu (void )@@ -303,7 +302,6 @@ static struct cpu_dev nsc_cpu_dev __cpui .c_vendor = "NSC", .c_ident = { "Geode by NSC" }, .c_init = init_cyrix, - .c_identify = generic_identify, };int __init nsc_init_cpu (void )xen/arch/x86/cpu/intel.c +0
-1@@ -329,7 +329,6 @@ static struct cpu_dev intel_cpu_dev __cp }, }, .c_init = init_intel, - .c_identify = generic_identify, .c_size_cache = intel_size_cache, };xen/arch/x86/cpu/transmeta.c +0
-1@@ -82,7 +82,6 @@ static void __init init_transmeta(structstatic void transmeta_identify (struct cpuinfo_x86 * c) {u32 xlvl; -generic_identify (c);/* Transmeta-defined flags: level 0x80860001 */ xlvl =cpuid_eax (0x80860000 );_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel