diff options
author | 2022-09-07 16:57:46 +0100 | |
---|---|---|
committer | 2022-09-10 16:18:55 -0700 | |
commit | 57c92f11a215717bf90880828b7a23c736c3c0d9 (patch) | |
tree | 68fb30e8a2deb915d17dfd8e53fd364de500e5b8 /tools/testing/selftests/bpf/prog_tests/bpf_nf.c | |
parent | bpf: add missing percpu_counter_destroy() in htab_map_alloc() (diff) | |
download | linux-dev-57c92f11a215717bf90880828b7a23c736c3c0d9.tar.xz linux-dev-57c92f11a215717bf90880828b7a23c736c3c0d9.zip |
bpf: Simplify code by using for_each_cpu_wrap()
In the percpu freelist code, it is a common pattern to iterate over
the possible CPUs mask starting with the current CPU. The pattern is
implemented using a hand rolled while loop with the loop variable
increment being open-coded.
Simplify the code by using for_each_cpu_wrap() helper to iterate over
the possible cpus starting with the current CPU. As a result, some of
the special-casing in the loop also gets simplified.
No functional change intended.
Signed-off-by: Punit Agrawal <punit.agrawal@bytedance.com>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20220907155746.1750329-1-punit.agrawal@bytedance.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/bpf_nf.c')
0 files changed, 0 insertions, 0 deletions