Commit dc37dc61 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann

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: 4172843e ("libbpf: Fix signedness bug in btf_dump_array_data()")
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220209063909.1268319-1-andrii@kernel.org
parent 3caa7d2e
...@@ -1869,7 +1869,8 @@ static int btf_dump_array_data(struct btf_dump *d, ...@@ -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_type = skip_mods_and_typedefs(d->btf, elem_type_id, NULL);
elem_size = btf__resolve_size(d->btf, elem_type_id); elem_size = btf__resolve_size(d->btf, elem_type_id);
if (elem_size <= 0) { 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; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment