Skip to content

Commit f49a4af

Browse files
committed
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]" <[email protected]> Reviewed-by: Douglas Anderson <[email protected]>
1 parent 8557c86 commit f49a4af

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

kernel/watchdog_buddy.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ static unsigned int watchdog_next_cpu(unsigned int cpu)
1212
{
1313
unsigned int next_cpu;
1414

15-
next_cpu = cpumask_next(cpu, &watchdog_cpus);
16-
if (next_cpu >= nr_cpu_ids)
17-
next_cpu = cpumask_first(&watchdog_cpus);
18-
15+
next_cpu = cpumask_next_wrap(cpu, &watchdog_cpus);
1916
if (next_cpu == cpu)
2017
return nr_cpu_ids;
2118

0 commit comments

Comments
 (0)