]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu()
authorYury Norov [NVIDIA] <yury.norov@gmail.com>
Thu, 5 Jun 2025 00:12:52 +0000 (20:12 -0400)
committerYury Norov <yury.norov@gmail.com>
Thu, 31 Jul 2025 15:28:03 +0000 (11:28 -0400)
The dedicated helper is more verbose and efficient comparing to
cpumask_next() followed by cpumask_first().

Signed-off-by: "Yury Norov [NVIDIA]" <yury.norov@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
kernel/watchdog_buddy.c

index 34dbfe091f4b1323ff362bb4b470c57e5db3b64e..ee754d767c2131e3cd34bccf26d8e6cf0e0b5f75 100644 (file)
@@ -12,10 +12,7 @@ static unsigned int watchdog_next_cpu(unsigned int cpu)
 {
        unsigned int next_cpu;
 
-       next_cpu = cpumask_next(cpu, &watchdog_cpus);
-       if (next_cpu >= nr_cpu_ids)
-               next_cpu = cpumask_first(&watchdog_cpus);
-
+       next_cpu = cpumask_next_wrap(cpu, &watchdog_cpus);
        if (next_cpu == cpu)
                return nr_cpu_ids;