aboutsummaryrefslogtreecommitdiff
path: root/drivers/cpufreq/scmi-cpufreq.c
diff options
context:
space:
mode:
authorGravatar Yury Norov <yury.norov@gmail.com> 2022-01-23 10:38:47 -0800
committerGravatar Viresh Kumar <viresh.kumar@linaro.org> 2022-02-09 13:20:03 +0530
commitb48cd0d12f8e3b5fc928ac84734e563eda8e430f (patch)
tree1d6b986be015c87c2644236ef7217251e522ce14 /drivers/cpufreq/scmi-cpufreq.c
parentcpufreq: qcom-hw: Delay enabling throttle_irq (diff)
downloadlinux-b48cd0d12f8e3b5fc928ac84734e563eda8e430f.tar.gz
linux-b48cd0d12f8e3b5fc928ac84734e563eda8e430f.tar.bz2
linux-b48cd0d12f8e3b5fc928ac84734e563eda8e430f.zip
cpufreq: replace cpumask_weight with cpumask_empty where appropriate
drivers/cpufreq calls cpumask_weight() to check if any bit of a given cpumask is set. We can do it more efficiently with cpumask_empty() because cpumask_empty() stops traversing the cpumask as soon as it finds first set bit, while cpumask_weight() counts all bits unconditionally. Signed-off-by: Yury Norov <yury.norov@gmail.com> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> (for SCMI cpufreq driver) Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/scmi-cpufreq.c')
-rw-r--r--drivers/cpufreq/scmi-cpufreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
index 1e0cd4d165f0..919fa6e3f462 100644
--- a/drivers/cpufreq/scmi-cpufreq.c
+++ b/drivers/cpufreq/scmi-cpufreq.c
@@ -154,7 +154,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
* table and opp-shared.
*/
ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, priv->opp_shared_cpus);
- if (ret || !cpumask_weight(priv->opp_shared_cpus)) {
+ if (ret || cpumask_empty(priv->opp_shared_cpus)) {
/*
* Either opp-table is not set or no opp-shared was found.
* Use the CPU mask from SCMI to designate CPUs sharing an OPP