aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-02-08 22:39:09 -0800
committerAndrii Nakryiko <andrii.nakryiko@gmail.com>2022-02-09 09:48:32 -0800
commit37493e639f9add8c06604c493657e533c835e0a1 (patch)
tree6b2ebb75270eaad073ee903b07cb4fff9e0f5b32
parentb0a3b9e8fe16f7ef8cdb2a526cf28b3e419db6b8 (diff)
downloadlibbpf-37493e639f9add8c06604c493657e533c835e0a1.tar.gz
libbpf: Fix compilation warning due to mismatched printf format
On ppc64le architecture __s64 is long int and requires %ld. Cast to ssize_t and use %zd to avoid architecture-specific specifiers. Fixes: 4172843ed4a3 ("libbpf: Fix signedness bug in btf_dump_array_data()") Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20220209063909.1268319-1-andrii@kernel.org
-rw-r--r--src/btf_dump.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/btf_dump.c b/src/btf_dump.c
index 55aed9e..07ebe70 100644
--- a/src/btf_dump.c
+++ b/src/btf_dump.c
@@ -1869,7 +1869,8 @@ static int btf_dump_array_data(struct btf_dump *d,
elem_type = skip_mods_and_typedefs(d->btf, elem_type_id, NULL);
elem_size = btf__resolve_size(d->btf, elem_type_id);
if (elem_size <= 0) {
- pr_warn("unexpected elem size %lld for array type [%u]\n", elem_size, id);
+ pr_warn("unexpected elem size %zd for array type [%u]\n",
+ (ssize_t)elem_size, id);
return -EINVAL;
}