diff options
author | Anton Protopopov <aspsk@isovalent.com> | 2023-07-19 11:29:51 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-07-19 18:48:52 +0200 |
commit | 9c29804961c1bbf5c879a1879fe5fcac6364736f (patch) | |
tree | 5ce13b8e01775fcd73924dbb3d35ee81c6a98264 /kernel/bpf/map_iter.c | |
parent | bpf: consider CONST_PTR_TO_MAP as trusted pointer to struct bpf_map (diff) | |
download | linux-9c29804961c1bbf5c879a1879fe5fcac6364736f.tar.xz linux-9c29804961c1bbf5c879a1879fe5fcac6364736f.zip |
bpf: make an argument const in the bpf_map_sum_elem_count kfunc
We use the map pointer only to read the counter values, no locking
involved, so mark the argument as const.
Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
Link: https://lore.kernel.org/r/20230719092952.41202-4-aspsk@isovalent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/map_iter.c')
-rw-r--r-- | kernel/bpf/map_iter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/map_iter.c b/kernel/bpf/map_iter.c index b67996147895..011adb41858e 100644 --- a/kernel/bpf/map_iter.c +++ b/kernel/bpf/map_iter.c @@ -197,7 +197,7 @@ __diag_push(); __diag_ignore_all("-Wmissing-prototypes", "Global functions as their definitions will be in vmlinux BTF"); -__bpf_kfunc s64 bpf_map_sum_elem_count(struct bpf_map *map) +__bpf_kfunc s64 bpf_map_sum_elem_count(const struct bpf_map *map) { s64 *pcount; s64 ret = 0; |