From 4ab2a3ec73a2780af4bc5062b09149ece1d73a1d Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Tue, 30 Sep 2014 21:18:47 +0400 Subject: [PATCH] cpuinfo: x86 -- Drop redundant cpu_has helper It's simply a wrapper over cpu_has_feature, so use this it directly instead. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- arch/x86/cpu.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/x86/cpu.c b/arch/x86/cpu.c index e180d2306..47f41fc1f 100644 --- a/arch/x86/cpu.c +++ b/arch/x86/cpu.c @@ -29,7 +29,6 @@ const char * const x86_cap_flags[NCAPINTS_BITS] = { }; static DECLARE_BITMAP(cpu_features, NCAPINTS_BITS); -#define cpu_has(bit) test_bit(bit, cpu_features) void cpu_set_feature(unsigned int feature) { @@ -40,7 +39,7 @@ void cpu_set_feature(unsigned int feature) bool cpu_has_feature(unsigned int feature) { if (likely(feature < NCAPINTS_BITS)) - return cpu_has(feature); + return test_bit(feature, cpu_features); return false; } @@ -67,17 +66,17 @@ int cpu_init(void) * Make sure that at least FPU is onboard * and fxsave is supported. */ - if (cpu_has(X86_FEATURE_FPU)) { - if (!cpu_has(X86_FEATURE_FXSR)) { + if (cpu_has_feature(X86_FEATURE_FPU)) { + if (!cpu_has_feature(X86_FEATURE_FXSR)) { pr_err("missing support fxsave/restore insns\n"); return -1; } } pr_debug("fpu:%d fxsr:%d xsave:%d\n", - !!cpu_has(X86_FEATURE_FPU), - !!cpu_has(X86_FEATURE_FXSR), - !!cpu_has(X86_FEATURE_XSAVE)); + !!cpu_has_feature(X86_FEATURE_FPU), + !!cpu_has_feature(X86_FEATURE_FXSR), + !!cpu_has_feature(X86_FEATURE_XSAVE)); return 0; }