Skip to content

Commit 813efda

Browse files
diandersakpm00
authored andcommitted
watchdog/buddy: don't copy the cpumask in watchdog_next_cpu()
There's no reason to make a copy of the "watchdog_cpus" locally in watchdog_next_cpu(). Making a copy wouldn't make things any more race free and we're just reading the value so there's no need for a copy. Link: https://lkml.kernel.org/r/20230526184139.7.If466f9a2b50884cbf6a1d8ad05525a2c17069407@changeid Signed-off-by: Douglas Anderson <dianders@chromium.org> Suggested-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent d3b62ac commit 813efda

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

kernel/watchdog_buddy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ static cpumask_t __read_mostly watchdog_cpus;
1010

1111
static unsigned int watchdog_next_cpu(unsigned int cpu)
1212
{
13-
cpumask_t cpus = watchdog_cpus;
1413
unsigned int next_cpu;
1514

16-
next_cpu = cpumask_next(cpu, &cpus);
15+
next_cpu = cpumask_next(cpu, &watchdog_cpus);
1716
if (next_cpu >= nr_cpu_ids)
18-
next_cpu = cpumask_first(&cpus);
17+
next_cpu = cpumask_first(&watchdog_cpus);
1918

2019
if (next_cpu == cpu)
2120
return nr_cpu_ids;

0 commit comments

Comments
 (0)