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
This commit is contained in:
committed by
Andrii Nakryiko
parent
1c593d7402
commit
d677a10f80
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user