]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clocksource: Replace cpumask_weight() with cpumask_empty()
authorYury Norov <yury.norov@gmail.com>
Thu, 10 Feb 2022 22:49:07 +0000 (14:49 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:41 +0000 (12:50 +0100)
commit4ae5e361537d8cd78f3b134d5036b3352884fe9f
treecdd0d66f019aba6a8a9c0dc3703396ad5f3e6ec8
parentacfebfb2abf388b53a1f7c6957007069b6020392
clocksource: Replace cpumask_weight() with cpumask_empty()

[ Upstream commit 8afbcaf8690dac19ebf570a4e4fef9c59c75bf8e ]

clocksource_verify_percpu() calls cpumask_weight() to check if any bit of a
given cpumask is set.

This can be done 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>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220210224933.379149-24-yury.norov@gmail.com
Stable-dep-of: 6bb05a33337b ("clocksource: Use migrate_disable() to avoid calling get_random_u32() in atomic context")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/time/clocksource.c