Skip to content

Commit 4fa7d61

Browse files
YuryNorovKAGA-KOKO
authored andcommitted
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@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: John Stultz <jstultz@google.com> Link: https://lore.kernel.org/all/20250614155031.340988-2-yury.norov@gmail.com
1 parent ff56a3e commit 4fa7d61

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

kernel/time/clocksource.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,7 @@ static void clocksource_verify_choose_cpus(void)
323323
return;
324324

325325
/* Make sure to select at least one CPU other than the current CPU. */
326-
cpu = cpumask_first(cpu_online_mask);
327-
if (cpu == smp_processor_id())
328-
cpu = cpumask_next(cpu, cpu_online_mask);
326+
cpu = cpumask_any_but(cpu_online_mask, smp_processor_id());
329327
if (WARN_ON_ONCE(cpu >= nr_cpu_ids))
330328
return;
331329
cpumask_set_cpu(cpu, &cpus_chosen);

0 commit comments

Comments
 (0)