From: Yury Norov [NVIDIA] Date: Thu, 5 Jun 2025 00:12:52 +0000 (-0400) Subject: watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f49a4af3fabce56aaef125f0d959b81afe194afb;p=thirdparty%2Flinux.git watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu() The dedicated helper is more verbose and efficient comparing to cpumask_next() followed by cpumask_first(). Signed-off-by: "Yury Norov [NVIDIA]" Reviewed-by: Douglas Anderson --- diff --git a/kernel/watchdog_buddy.c b/kernel/watchdog_buddy.c index 34dbfe091f4b1..ee754d767c213 100644 --- a/kernel/watchdog_buddy.c +++ b/kernel/watchdog_buddy.c @@ -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;