Skip to contentSkip to conversation

libbpf: fix another __u64 printf warning

PATCH Applied Andrii Nakryiko 2 participants 2 messages Dec 19, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbpf: fix another __u64 printf warning

Fix yet another printf warning for %llu specifier on ppc64le. This time size_t casting won't work, so cast to verbose unsigned long long.

Fixes 166750bc1dd2 ("libbpf: Support libbpf-provided extern variables")
---
 tools/lib/bpf/libbpf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/bpf/libbpf.c +2 -2
index 6340b81b555b..e5a6b07060fb 100644
@@ -1129,12 +1129,12 @@ static int set_ext_value_num(struct extern_desc *ext, void *ext_val,
 {
 	if (ext->type != EXT_INT && ext->type != EXT_CHAR) {
 		pr_warn("extern %s=%llu should be integer\n",
-			ext->name, value);
+			ext->name, (unsigned long long)value);
 		return -EINVAL;
 	}
 	if (!is_ext_value_in_range(ext, value)) {
 		pr_warn("extern %s=%llu value doesn't fit in %d bytes\n",
-			ext->name, value, ext->sz);
+			ext->name, (unsigned long long)value, ext->sz);
 		return -ERANGE;
 	}
 	switch (ext->sz) {
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Andrii Nakryiko

Fix yet another printf warning for %llu specifier on ppc64le. This time size_t casting won't work, so cast to verbose unsigned long long.

Fixes 166750bc1dd2 ("libbpf: Support libbpf-provided extern variables")

Applied, thanks!