cpufreq: replace cpumask_weight with cpumask_empty where appropriate
authorYury Norov <yury.norov@gmail.com>
Sun, 23 Jan 2022 18:38:47 +0000 (10:38 -0800)
committerViresh Kumar <viresh.kumar@linaro.org>
Wed, 9 Feb 2022 07:50:03 +0000 (13:20 +0530)
commitb48cd0d12f8e3b5fc928ac84734e563eda8e430f
tree1d6b986be015c87c2644236ef7217251e522ce14
parentef8ee1cb8fc8976a68f5e89cd5f7b6f7de80c66f
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>
drivers/cpufreq/qcom-cpufreq-hw.c
drivers/cpufreq/scmi-cpufreq.c