]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clocksource: Use cpumask_next_wrap() in clocksource_watchdog()
authorYury Norov [NVIDIA] <yury.norov@gmail.com>
Sat, 14 Jun 2025 15:50:30 +0000 (11:50 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 14 Jun 2025 18:09:44 +0000 (20:09 +0200)
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
kernel/time/clocksource.c

index a2f2e9f4d37b4f132d6e9888be176b9d4358ae48..e400fe150f9d70d372170be37a757c50fd56b0e4 100644 (file)
@@ -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