Commit 24858a84 authored by Kaushlendra Kumar's avatar Kaushlendra Kumar Committed by Shuah Khan
Browse files

tools/cpupower: Fix inverted APERF capability check

The capability check was inverted, causing the function to return
error when APERF support is available and proceed when it is not.

Negate the condition to return error only when APERF capability
is absent.

Link: https://lore.kernel.org/r/20251126091613.567480-1-kaushlendra.kumar@intel.com


Signed-off-by: default avatarKaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 6b401a5b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ static int get_freq_hardware(unsigned int cpu, unsigned int human)
{
	unsigned long freq;

	if (cpupower_cpu_info.caps & CPUPOWER_CAP_APERF)
	if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_APERF))
		return -EINVAL;

	freq = cpufreq_get_freq_hardware(cpu);