summaryrefslogtreecommitdiffstats
path: root/samples/bpf
diff options
context:
space:
mode:
authorHengqi Chen <hengqi.chen@gmail.com>2021-10-04 00:58:44 +0800
committerAndrii Nakryiko <andrii@kernel.org>2021-10-06 12:34:02 -0700
commit6f2b219b62a4376ca2da15c503de79d0650c8155 (patch)
treed6b57e0ba51373477c58bea70ec99e43e553913e /samples/bpf
parent2088a3a71d870115fdfb799c0f7de76d7383ba03 (diff)
downloadlinux-stable-6f2b219b62a4376ca2da15c503de79d0650c8155.tar.gz
linux-stable-6f2b219b62a4376ca2da15c503de79d0650c8155.tar.bz2
linux-stable-6f2b219b62a4376ca2da15c503de79d0650c8155.zip
selftests/bpf: Switch to new bpf_object__next_{map,program} APIs
Replace deprecated bpf_{map,program}__next APIs with newly added bpf_object__next_{map,program} APIs, so that no compilation warnings emit. Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20211003165844.4054931-3-hengqi.chen@gmail.com
Diffstat (limited to 'samples/bpf')
-rw-r--r--samples/bpf/xdp1_user.c2
-rw-r--r--samples/bpf/xdp_sample_pkts_user.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/xdp1_user.c b/samples/bpf/xdp1_user.c
index 116e39f6b666..8675fa5273df 100644
--- a/samples/bpf/xdp1_user.c
+++ b/samples/bpf/xdp1_user.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
if (bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd))
return 1;
- map = bpf_map__next(NULL, obj);
+ map = bpf_object__next_map(obj, NULL);
if (!map) {
printf("finding a map in obj file failed\n");
return 1;
diff --git a/samples/bpf/xdp_sample_pkts_user.c b/samples/bpf/xdp_sample_pkts_user.c
index 495e09897bd3..f4382ccdcbb1 100644
--- a/samples/bpf/xdp_sample_pkts_user.c
+++ b/samples/bpf/xdp_sample_pkts_user.c
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
return 1;
}
- map = bpf_map__next(NULL, obj);
+ map = bpf_object__next_map(obj, NULL);
if (!map) {
printf("finding a map in obj file failed\n");
return 1;