From: Thomas Renninger Date: Fri, 21 Jan 2011 14:11:19 +0000 (+0100) Subject: tools: turbostat: fix bitwise and operand X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8209e054b6bd0805a25b8c4af971160fa146bf22;p=linux-beck.git tools: turbostat: fix bitwise and operand bug could cause false positive on indicating presence of invarient TSC or APERF support. Signed-off-by: Thomas Renninger Signed-off-by: Len Brown --- diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 4c6983de6fd9..a96248f19264 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -892,7 +892,7 @@ void check_cpuid() * this check is valid for both Intel and AMD */ asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x80000007)); - has_invariant_tsc = edx && (1 << 8); + has_invariant_tsc = edx & (1 << 8); if (!has_invariant_tsc) { fprintf(stderr, "No invariant TSC\n"); @@ -905,7 +905,7 @@ void check_cpuid() */ asm("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x6)); - has_aperf = ecx && (1 << 0); + has_aperf = ecx & (1 << 0); if (!has_aperf) { fprintf(stderr, "No APERF MSR\n"); exit(1);