x86: use enum cpuid_leafs instead of magic numbers
Subsystems (3)
PATCH 1/1 x86: use enum cpuid_leafs instead of magic numbers
Signed-off-by Huaitong Han <[email protected]>
--- arch/x86/include/asm/elf.h | 2 +- arch/x86/kernel/mpparse.c | 2 +- arch/x86/lguest/boot.c | 2 +- arch/x86/xen/enlighten.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/elf.h +1 -1
@@ -256,7 +256,7 @@ extern int force_personality32;instruction set this CPU supports. This could be done in user space, but it's not easy, and we've already done it here. */ -#define ELF_HWCAP (boot_cpu_data.x86_capability[0]) +#define ELF_HWCAP (boot_cpu_data.x86_capability[CPUID_1_EDX])/* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in
arch/x86/kernel/mpparse.c +1 -1
@@ -408,7 +408,7 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) processor.cpuflag =CPU_ENABLED ; processor.cpufeature = (boot_cpu_data.x86 <<8 ) | (boot_cpu_data.x86_model <<4 ) | boot_cpu_data.x86_mask; - processor.featureflag = boot_cpu_data.x86_capability[0 ]; + processor.featureflag = boot_cpu_data.x86_capability[CPUID_1_EDX ]; processor.reserved[0 ] =0 ; processor.reserved[1 ] =0 ;for (i =0 ; i <2 ; i++) {
arch/x86/lguest/boot.c +1 -1
@@ -1535,7 +1535,7 @@ __init void lguest_init(void)*/ cpu_detect (&new_cpu_data);/* head.S usually sets up the first capability word, so do it here. */ - new_cpu_data.x86_capability[0 ] =cpuid_edx (1 ); + new_cpu_data.x86_capability[CPUID_1_EDX ] =cpuid_edx (1 );/* Math is always hard! */ set_cpu_cap (&new_cpu_data,X86_FEATURE_FPU );
arch/x86/xen/enlighten.c +1 -1
@@ -1654,7 +1654,7 @@ asmlinkage __visible void __init xen_start_kernel(void)cpu_detect (&new_cpu_data);set_cpu_cap (&new_cpu_data,X86_FEATURE_FPU ); new_cpu_data.wp_works_ok =1 ; - new_cpu_data.x86_capability[0 ] =cpuid_edx (1 ); + new_cpu_data.x86_capability[CPUID_1_EDX ] =cpuid_edx (1 );#endif if (xen_start_info->mod_start) {
Signature · 1 line
2.4.3
Borislav Petkov
maintainerQuoted 7 lines · Huaitong Han
Signed-off-by Huaitong Han <[email protected]>--- arch/x86/include/asm/elf.h | 2 +- arch/x86/kernel/mpparse.c | 2 +- arch/x86/lguest/boot.c | 2 +- arch/x86/xen/enlighten.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
Please add a commit message, albeit a trivial one.
Looks ok otherwise.
Thanks.
Signature · 4 lines
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.