diff options
| author | Kaushlendra Kumar <kaushlendra.kumar@intel.com> | 2025-11-26 14:46:13 +0530 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:19:35 -0500 |
| commit | ebbf7024009a349a42bcc96de6da413ef92d89a7 (patch) | |
| tree | f30667b36d43767289f9f7376d5115c3c5d4158d /tools/power | |
| parent | 76cc4faba0343c6db945b8dc75425b33d633e1b8 (diff) | |
tools/cpupower: Fix inverted APERF capability check
[ Upstream commit 24858a84163c8d04827166b3bcaed80612bb62fc ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/power')
| -rw-r--r-- | tools/power/cpupower/utils/cpufreq-info.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c index 7d3732f5f2f6..5fe01e516817 100644 --- a/tools/power/cpupower/utils/cpufreq-info.c +++ b/tools/power/cpupower/utils/cpufreq-info.c @@ -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); |
