Skip to content

Commit

Permalink
selftest/bpf: replace magic constants by macros
Browse files Browse the repository at this point in the history
Replace magic constants in a BTF structure initialization code by
proper macros, as is done in other similar selftests.

Signed-off-by: Anton Protopopov <[email protected]>
Suggested-by: Eduard Zingerman <[email protected]>
  • Loading branch information
aspsk authored and Kernel Patches Daemon committed Dec 3, 2024
1 parent 07dce1a commit 684e931
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/testing/selftests/bpf/progs/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 684e931

Please sign in to comment.