From: Luo Yifan Date: Tue, 12 Nov 2024 07:37:01 +0000 (+0800) Subject: bpftool: Cast variable `var` to long long X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b7b31f184f88c0cbd5d53dfc9a6532d851311135;p=users%2Fwilly%2Fxarray.git bpftool: Cast variable `var` to long long When the SIGNED condition is met, the variable `var` should be cast to `long long` instead of `unsigned long long`. Signed-off-by: Luo Yifan Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20241112073701.283362-1-luoyifan@cmss.chinamobile.com --- diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c index 547c1ccdce98..d005e4fd6128 100644 --- a/tools/bpf/bpftool/btf.c +++ b/tools/bpf/bpftool/btf.c @@ -289,7 +289,7 @@ static int dump_btf_type(const struct btf *btf, __u32 id, } else { if (btf_kflag(t)) printf("\n\t'%s' val=%lldLL", name, - (unsigned long long)val); + (long long)val); else printf("\n\t'%s' val=%lluULL", name, (unsigned long long)val);