aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
diff options
context:
space:
mode:
authorHengqi Chen <[email protected]>2021-10-22 13:06:23 +0000
committerAndrii Nakryiko <[email protected]>2021-10-22 23:09:14 +0000
commit487ef148cf17730442444c07a4c56f16578ec73e (patch)
treeb2c6ec554b4b21bb648bf273b9acbd215fc9f813 /tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
parentbpftool: Switch to new btf__type_cnt API (diff)
downloadkernel-487ef148cf17730442444c07a4c56f16578ec73e.tar.gz
kernel-487ef148cf17730442444c07a4c56f16578ec73e.zip
selftests/bpf: Switch to new btf__type_cnt/btf__raw_data APIs
Replace the calls to btf__get_nr_types/btf__get_raw_data in selftests with new APIs btf__type_cnt/btf__raw_data. The old APIs will be deprecated in libbpf v0.7+. Signed-off-by: Hengqi Chen <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/resolve_btfids.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/resolve_btfids.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
index f62361306f6d..badda6309fd9 100644
--- a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
+++ b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
@@ -106,9 +106,9 @@ static int resolve_symbols(void)
"Failed to load BTF from btf_data.o\n"))
return -1;
- nr = btf__get_nr_types(btf);
+ nr = btf__type_cnt(btf);
- for (type_id = 1; type_id <= nr; type_id++) {
+ for (type_id = 1; type_id < nr; type_id++) {
if (__resolve_symbol(btf, type_id))
break;
}