diff options
author | Punit Agrawal <punit.agrawal@bytedance.com> | 2022-09-07 18:57:46 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-09-11 02:18:55 +0300 |
commit | 57c92f11a215717bf90880828b7a23c736c3c0d9 (patch) | |
tree | 68fb30e8a2deb915d17dfd8e53fd364de500e5b8 /tools/testing/selftests/bpf/prog_tests/bpf_nf.c | |
parent | cf7de6a53600ea554a8358e44fbcf47b449235f9 (diff) | |
download | linux-57c92f11a215717bf90880828b7a23c736c3c0d9.tar.xz |
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