From e6f6fe38773914f732d1e0003859a4bd36f26292 Mon Sep 17 00:00:00 2001 From: Ahmed Samy Date: Fri, 11 Oct 2013 13:08:48 +0200 Subject: [PATCH] cpuid: remove the static func has_feature Signed-off-by: Ahmed Samy --- ccan/cpuid/cpuid.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/ccan/cpuid/cpuid.c b/ccan/cpuid/cpuid.c index cab887b1..55a08921 100644 --- a/ccan/cpuid/cpuid.c +++ b/ccan/cpuid/cpuid.c @@ -90,22 +90,6 @@ static struct { { CEF_XOP, 1 << 11, false } }; -static bool has_feature(int feature, uint32_t ecx, uint32_t edx) -{ - int i; - - for (i = 0; i < sizeof(features) / sizeof(features[0]); ++i) { - if (features[i].feature == feature) { - if (features[i].use_edx) - return (edx & features[i].mask); - else - return (ecx & features[i].mask); - } - } - - return false; -} - bool cpuid_is_supported(void) { /* The following assembly code uses EAX as the return value, @@ -180,7 +164,15 @@ bool cpuid_has_feature(int feature, bool extended) else ___cpuid(CPU_EXTENDED_PROC_INFO_FEATURE_BITS, &eax, &ebx, &ecx, &edx); - return has_feature(feature, ecx, edx); + for (i = 0; i < sizeof(features) / sizeof(features[0]); ++i) { + if (features[i].feature == feature) { + if (features[i].use_edx) + return (edx & features[i].mask); + else + return (ecx & features[i].mask); + } + } + return false; } static const char *const cpuids[] = { -- 2.39.2