Skip to content

Commit bfa788d

Browse files
YuryNorovKAGA-KOKO
authored andcommitted
clocksource: Use cpumask_next_wrap() in clocksource_watchdog()
cpumask_next_wrap() is more verbose and efficient comparing to cpumask_next() followed by cpumask_first(). 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-3-yury.norov@gmail.com
1 parent 4fa7d61 commit bfa788d

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
@@ -587,9 +587,7 @@ static void clocksource_watchdog(struct timer_list *unused)
587587
* Cycle through CPUs to check if the CPUs stay synchronized
588588
* to each other.
589589
*/
590-
next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
591-
if (next_cpu >= nr_cpu_ids)
592-
next_cpu = cpumask_first(cpu_online_mask);
590+
next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask);
593591

594592
/*
595593
* Arm timer if not already pending: could race with concurrent

0 commit comments

Comments
 (0)