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] <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: John Stultz <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent ff56a3e commit 4fa7d61

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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)