diff options
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/resolve_btfids.c')
| -rw-r--r-- | tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | 14 | 
1 files changed, 6 insertions, 8 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..f4a13d9dd5c8 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;  	} @@ -117,14 +117,14 @@ static int resolve_symbols(void)  	return 0;  } -int test_resolve_btfids(void) +void test_resolve_btfids(void)  {  	__u32 *test_list, *test_lists[] = { test_list_local, test_list_global };  	unsigned int i, j;  	int ret = 0;  	if (resolve_symbols()) -		return -1; +		return;  	/* Check BTF_ID_LIST(test_list_local) and  	 * BTF_ID_LIST_GLOBAL(test_list_global) IDs @@ -138,7 +138,7 @@ int test_resolve_btfids(void)  				    test_symbols[i].name,  				    test_list[i], test_symbols[i].id);  			if (ret) -				return ret; +				return;  		}  	} @@ -161,9 +161,7 @@ int test_resolve_btfids(void)  		if (i > 0) {  			if (!ASSERT_LE(test_set.ids[i - 1], test_set.ids[i], "sort_check")) -				return -1; +				return;  		}  	} - -	return ret;  } |