Commit bfa788dc authored by Yury Norov [NVIDIA]'s avatar Yury Norov [NVIDIA] Committed by Thomas Gleixner
Browse files

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: default avatarYury Norov [NVIDIA] <yury.norov@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarJohn Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20250614155031.340988-3-yury.norov@gmail.com
parent 4fa7d61d
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -587,9 +587,7 @@ static void clocksource_watchdog(struct timer_list *unused)
	 * Cycle through CPUs to check if the CPUs stay synchronized
	 * to each other.
	 */
	next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
	if (next_cpu >= nr_cpu_ids)
		next_cpu = cpumask_first(cpu_online_mask);
	next_cpu = cpumask_next_wrap(raw_smp_processor_id(), cpu_online_mask);

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