]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix ptr_is_aligned() usages
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 21 Oct 2021 10:46:58 +0000 (12:46 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Oct 2021 22:50:04 +0000 (15:50 -0700)
commit4087b49874408677c4d4705dbd1d575aaa2e4f6c
treeb5fa2fd6b0bde0c5dfa561194a57cb799f4196b9
parent7e25b3488bc703fad17d18182e3066ac5727d03a
libbpf: Fix ptr_is_aligned() usages

Currently ptr_is_aligned() takes size, and not alignment, as a
parameter, which may be overly pessimistic e.g. for __i128 on s390,
which must be only 8-byte aligned. Fix by using btf__align_of().

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211021104658.624944-2-iii@linux.ibm.com
tools/lib/bpf/btf_dump.c