diff options
author | 2024-12-13 13:09:34 +0000 | |
---|---|---|
committer | 2024-12-13 14:48:39 -0800 | |
commit | d677a10f80abf1ef65ae9bcf51b5a83ecf10e99a (patch) | |
tree | 0acb5f6324ae0ab1cee6d3d41a0b6840a4255dda /tools/testing/selftests/bpf/progs/syscall.c | |
parent | selftests/bpf: Add tests for fd_array_cnt (diff) | |
download | wireguard-linux-d677a10f80abf1ef65ae9bcf51b5a83ecf10e99a.tar.xz wireguard-linux-d677a10f80abf1ef65ae9bcf51b5a83ecf10e99a.zip |
selftest/bpf: Replace magic constants by macros
Replace magic constants in a BTF structure initialization code by
proper macros, as is done in other similar selftests.
Suggested-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Anton Protopopov <aspsk@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20241213130934.1087929-8-aspsk@isovalent.com
Diffstat (limited to '')
-rw-r--r-- | tools/testing/selftests/bpf/progs/syscall.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/progs/syscall.c b/tools/testing/selftests/bpf/progs/syscall.c index 0f4dfb770c32..b698cc62a371 100644 --- a/tools/testing/selftests/bpf/progs/syscall.c +++ b/tools/testing/selftests/bpf/progs/syscall.c @@ -76,9 +76,9 @@ static int btf_load(void) .magic = BTF_MAGIC, .version = BTF_VERSION, .hdr_len = sizeof(struct btf_header), - .type_len = sizeof(__u32) * 8, - .str_off = sizeof(__u32) * 8, - .str_len = sizeof(__u32), + .type_len = sizeof(raw_btf.types), + .str_off = offsetof(struct btf_blob, str) - offsetof(struct btf_blob, types), + .str_len = sizeof(raw_btf.str), }, .types = { /* long */ |