Skip to content

Commit 24858a8

Browse files
kaushlenshuahkh
authored andcommitted
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: Kaushlendra Kumar <kaushlendra.kumar@intel.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 6b401a5 commit 24858a8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/power/cpupower/utils/cpufreq-info.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static int get_freq_hardware(unsigned int cpu, unsigned int human)
270270
{
271271
unsigned long freq;
272272

273-
if (cpupower_cpu_info.caps & CPUPOWER_CAP_APERF)
273+
if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_APERF))
274274
return -EINVAL;
275275

276276
freq = cpufreq_get_freq_hardware(cpu);

0 commit comments

Comments
 (0)