[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220510154750.212913-22-yury.norov@gmail.com>
Date: Tue, 10 May 2022 08:47:49 -0700
From: Yury Norov <yury.norov@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
David Laight <David.Laight@...LAB.COM>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Joe Perches <joe@...ches.com>,
Julia Lawall <Julia.Lawall@...ia.fr>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Nicholas Piggin <npiggin@...il.com>,
Nicolas Palix <nicolas.palix@...g.fr>,
Peter Zijlstra <peterz@...radead.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>,
linux-pm@...r.kernel.org
Subject: [PATCH 21/22] cpufreq: use cpumask_weight_gt() in policy_is_shared()
cpumask_weight_gt() is better than cpumask_weight() because it may
return earlier depending on condition.
CC: Rafael J. Wysocki <rafael@...nel.org>
CC: Viresh Kumar <viresh.kumar@...aro.org>
CC: linux-pm@...r.kernel.org
CC: linux-kernel@...r.kernel.org
Signed-off-by: Yury Norov <yury.norov@...il.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
Powered by blists - more mailing lists