diff options
author | Luo Yifan <luoyifan@cmss.chinamobile.com> | 2024-11-12 15:37:01 +0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-11-13 12:17:12 -0800 |
commit | b7b31f184f88c0cbd5d53dfc9a6532d851311135 (patch) | |
tree | 394908cd824ef8c8aa80c96f4bb5fbe45c66f6d0 /tools/bpf/bpftool/btf.c | |
parent | a1087da9d11e5bcacc706002bc0f84b790881f69 (diff) |
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 <luoyifan@cmss.chinamobile.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Quentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/bpf/20241112073701.283362-1-luoyifan@cmss.chinamobile.com
Diffstat (limited to 'tools/bpf/bpftool/btf.c')
-rw-r--r-- | tools/bpf/bpftool/btf.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |