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] <[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 4fa7d61 commit bfa788d

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
@@ -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)