]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
bpf: selftests: Fix bpf_map_sum_elem_count() kfunc prototype
authorDaniel Xu <dxu@dxuuu.xyz>
Wed, 12 Jun 2024 15:58:29 +0000 (09:58 -0600)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 12 Jun 2024 18:01:31 +0000 (11:01 -0700)
The prototype in progs/map_percpu_stats.c is not in line with how the
actual kfuncs are defined in kernel/bpf/map_iter.c. This causes
compilation errors when kfunc prototypes are generated from BTF.

Fix by aligning with actual kfunc definitions.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/0497e11a71472dcb71ada7c90ad691523ae87c3b.1718207789.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/progs/map_percpu_stats.c

index 10b2325c17207b960e230708731df43006c3d07e..63245785eb69e0b2967ce68941e6e8f4f016de4e 100644 (file)
@@ -7,7 +7,7 @@
 
 __u32 target_id;
 
-__s64 bpf_map_sum_elem_count(struct bpf_map *map) __ksym;
+__s64 bpf_map_sum_elem_count(const struct bpf_map *map) __ksym;
 
 SEC("iter/bpf_map")
 int dump_bpf_map(struct bpf_iter__bpf_map *ctx)