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 <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Reviewed-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent a1087da commit b7b31f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)