Messages in this thread Patch in this message | | | From | Yury Norov <> | Subject | [PATCH 21/22] cpufreq: use cpumask_weight_gt() in policy_is_shared() | Date | Tue, 10 May 2022 08:47:49 -0700 |
| |
cpumask_weight_gt() is better than cpumask_weight() because it may return earlier depending on condition.
CC: Rafael J. Wysocki <rafael@kernel.org> CC: Viresh Kumar <viresh.kumar@linaro.org> CC: linux-pm@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: Yury Norov <yury.norov@gmail.com> --- include/linux/cpufreq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index d5595d57f4e5..865cc9e23518 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -214,7 +214,7 @@ static inline bool policy_is_inactive(struct cpufreq_policy *policy) static inline bool policy_is_shared(struct cpufreq_policy *policy) { - return cpumask_weight(policy->cpus) > 1; + return cpumask_weight_gt(policy->cpus, 1); } #ifdef CONFIG_CPU_FREQ -- 2.32.0
| |