lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <174992496671.406.7971020073622211674.tip-bot2@tip-bot2>
Date: Sat, 14 Jun 2025 18:16:06 -0000
From: "tip-bot2 for Yury Norov [NVIDIA]" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Yury Norov [NVIDIA]" <yury.norov@...il.com>,
 Thomas Gleixner <tglx@...utronix.de>, John Stultz <jstultz@...gle.com>,
 x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: timers/core] clocksource: Use cpumask_any_but() in
 clocksource_verify_choose_cpus()

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     4fa7d61d5a02ad57a05c69365db293afddf678fc
Gitweb:        https://git.kernel.org/tip/4fa7d61d5a02ad57a05c69365db293afddf678fc
Author:        Yury Norov [NVIDIA] <yury.norov@...il.com>
AuthorDate:    Sat, 14 Jun 2025 11:50:29 -04:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Sat, 14 Jun 2025 20:09:44 +02:00

clocksource: Use cpumask_any_but() in clocksource_verify_choose_cpus()

cpumask_any_but() is more verbose than cpumask_first() followed by
cpumask_next(). Use it in clocksource_verify_choose_cpus().

Signed-off-by: Yury Norov [NVIDIA] <yury.norov@...il.com>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: John Stultz <jstultz@...gle.com>
Link: https://lore.kernel.org/all/20250614155031.340988-2-yury.norov@gmail.com

---
 kernel/time/clocksource.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 6a8bc7d..a2f2e9f 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -323,9 +323,7 @@ static void clocksource_verify_choose_cpus(void)
 		return;
 
 	/* Make sure to select at least one CPU other than the current CPU. */
-	cpu = cpumask_first(cpu_online_mask);
-	if (cpu == smp_processor_id())
-		cpu = cpumask_next(cpu, cpu_online_mask);
+	cpu = cpumask_any_but(cpu_online_mask, smp_processor_id());
 	if (WARN_ON_ONCE(cpu >= nr_cpu_ids))
 		return;
 	cpumask_set_cpu(cpu, &cpus_chosen);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ