Skip to content

Commit b7b31f1

Browse files
Luo Yifananakryiko
authored andcommitted
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
1 parent a1087da commit b7b31f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/bpf/bpftool/btf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static int dump_btf_type(const struct btf *btf, __u32 id,
289289
} else {
290290
if (btf_kflag(t))
291291
printf("\n\t'%s' val=%lldLL", name,
292-
(unsigned long long)val);
292+
(long long)val);
293293
else
294294
printf("\n\t'%s' val=%lluULL", name,
295295
(unsigned long long)val);

0 commit comments

Comments
 (0)