Blob Blame History Raw
From: Andrii Nakryiko <andrii@kernel.org>
Date: Tue, 8 Feb 2022 22:39:09 -0800
Subject: libbpf: Fix compilation warning due to mismatched printf format
Patch-mainline: v5.18-rc1
Git-commit: dc37dc617fabfb1c3a16d49f5d8cc20e9e3608ca
References: jsc#PED-1377

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
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
 tools/lib/bpf/btf_dump.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/tools/lib/bpf/btf_dump.c
+++ b/tools/lib/bpf/btf_dump.c
@@ -1869,7 +1869,8 @@ static int btf_dump_array_data(struct bt
 	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;
 	}