diff options
author | Yury Norov <yury.norov@gmail.com> | 2022-01-23 21:38:47 +0300 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2022-02-09 10:50:03 +0300 |
commit | b48cd0d12f8e3b5fc928ac84734e563eda8e430f (patch) | |
tree | 1d6b986be015c87c2644236ef7217251e522ce14 /drivers/cpufreq/qcom-cpufreq-hw.c | |
parent | ef8ee1cb8fc8976a68f5e89cd5f7b6f7de80c66f (diff) | |
download | linux-b48cd0d12f8e3b5fc928ac84734e563eda8e430f.tar.xz |
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/qcom-cpufreq-hw.c')
-rw-r--r-- | drivers/cpufreq/qcom-cpufreq-hw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index effbb680b453..c2cda28682a5 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -482,7 +482,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) } qcom_get_related_cpus(index, policy->cpus); - if (!cpumask_weight(policy->cpus)) { + if (cpumask_empty(policy->cpus)) { dev_err(dev, "Domain-%d failed to get related CPUs\n", index); ret = -ENOENT; goto error; |