Skip to content

Commit 7a05f1b

Browse files
Fushuai WangKernel Patches Daemon
authored andcommitted
bpf: Use cpumask_next_wrap() in get_next_cpu()
Replace the manual sequence of cpumask_next() and cpumask_first() with a single call to cpumask_next_wrap() in get_next_cpu(). Signed-off-by: Fushuai Wang <[email protected]> Acked-by: Yonghong Song <[email protected]>
1 parent 72d3b3e commit 7a05f1b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

kernel/bpf/bpf_lru_list.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121

2222
static int get_next_cpu(int cpu)
2323
{
24-
cpu = cpumask_next(cpu, cpu_possible_mask);
25-
if (cpu >= nr_cpu_ids)
26-
cpu = cpumask_first(cpu_possible_mask);
27-
return cpu;
24+
return cpumask_next_wrap(cpu, cpu_possible_mask);
2825
}
2926

3027
/* Local list helpers */

0 commit comments

Comments
 (0)