Blob Blame History Raw
From: Andrii Nakryiko <andriin@fb.com>
Date: Thu, 3 Sep 2020 21:16:10 -0700
Subject: libbpf: Fix another __u64 cast in printf
Patch-mainline: v5.10-rc1
Git-commit: 17e54b096e6a8dc92b92c59c2e3437550383b27a
References: bsc#1177028

Another issue of __u64 needing either %lu or %llu, depending on the
architecture. Fix with cast to `unsigned long long`.

Fixes: 7e06aad52929 ("libbpf: Add multi-prog section support for struct_ops")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200904041611.1695163-1-andriin@fb.com
Acked-by: Gary Lin <glin@suse.com>
---
 tools/lib/bpf/libbpf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -8136,7 +8136,7 @@ static int bpf_object__collect_st_ops_re
 		}
 		if (sym.st_value % BPF_INSN_SZ) {
 			pr_warning("struct_ops reloc %s: invalid target program offset %llu\n",
-				   map->name, (__u64)sym.st_value);
+				   map->name, (unsigned long long)sym.st_value);
 			return -LIBBPF_ERRNO__FORMAT;
 		}
 		insn_idx = sym.st_value / BPF_INSN_SZ;