watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu()
PATCH 1/1 watchdog: fix opencoded cpumask_next_wrap() in watchdog_next_cpu()
From: Yury Norov [NVIDIA] <[email protected]>
The dedicated helper is more verbose and efficient comparing to cpumask_next() followed by cpumask_first().
Signed-off-by Yury Norov [NVIDIA] <[email protected]>
--- kernel/watchdog_buddy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
kernel/watchdog_buddy.c +1 -4
@@ -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;
Signature · 1 line
2.43.0
Hi,
Quoted 10 lines · Yury Norov
From: Yury Norov [NVIDIA] <[email protected]>
The dedicated helper is more verbose and efficient comparing to
cpumask_next()followed bycpumask_first().Signed-off-by Yury Norov [NVIDIA] <[email protected]>--- kernel/watchdog_buddy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
Reviewed-by Douglas Anderson <[email protected]>
Quoted 9 lines · Doug Anderson
Hi,
Quoted 6 lines · Yury Norov
From: Yury Norov [NVIDIA] <[email protected]>
The dedicated helper is more verbose and efficient comparing to
cpumask_next()followed bycpumask_first().
Quoted 6 lines
Quoted 4 lines
Signed-off-by Yury Norov [NVIDIA] <[email protected]>--- kernel/watchdog_buddy.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)Reviewed-by Douglas Anderson <[email protected]>
Thanks, Douglas. Adding in bitmap-for-next for testing.