]> www.infradead.org Git - users/dwmw2/linux.git/commit
libbpf: Fix printf compilation warnings on ppc64le arch
authorAndrii Nakryiko <andriin@fb.com>
Thu, 12 Dec 2019 17:19:18 +0000 (09:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:36:58 +0000 (04:36 -0800)
commit11cee08dce69360d7a233c18b867fa1dbef1d04a
tree232352e60c621802c937f703773dd7db57dfb0e5
parent9a5d50b023de4a27e4184cd7a883c55d530cc11a
libbpf: Fix printf compilation warnings on ppc64le arch

commit 679152d3a32e305c213f83160c328c37566ae8bc upstream.

On ppc64le __u64 and __s64 are defined as long int and unsigned long int,
respectively. This causes compiler to emit warning when %lld/%llu are used to
printf 64-bit numbers. Fix this by casting to size_t/ssize_t with %zu and %zd
format specifiers, respectively.

v1->v2:
- use size_t/ssize_t instead of custom typedefs (Martin).

Fixes: 1f8e2bcb2cd5 ("libbpf: Refactor relocation handling")
Fixes: abd29c931459 ("libbpf: allow specifying map definitions using BTF")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191212171918.638010-1-andriin@fb.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/lib/bpf/libbpf.c