Skip to content
Commit 57c92f11 authored by Punit Agrawal's avatar Punit Agrawal Committed by Alexei Starovoitov
Browse files

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: default avatarPunit Agrawal <punit.agrawal@bytedance.com>
Acked-by: default avatarSong Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20220907155746.1750329-1-punit.agrawal@bytedance.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent cf7de6a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment