mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
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>
This commit is contained in:
parent
5ba190c29c
commit
9c29804961
@ -197,7 +197,7 @@ __diag_push();
|
|||||||
__diag_ignore_all("-Wmissing-prototypes",
|
__diag_ignore_all("-Wmissing-prototypes",
|
||||||
"Global functions as their definitions will be in vmlinux BTF");
|
"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 *pcount;
|
||||||
s64 ret = 0;
|
s64 ret = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user