]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Assume unsigned values for BTF_KIND_ENUM
authorAndrii Nakryiko <andriin@fb.com>
Tue, 3 Mar 2020 00:32:32 +0000 (16:32 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 4 Mar 2020 16:00:06 +0000 (17:00 +0100)
commitd55ca18c467e74901d51c86061466d36954ed199
tree6c4b74c76a30b236f29194e04c01d292f171e862
parent01e7cbad6889142881c6bea79727a698fb573d7b
libbpf: Assume unsigned values for BTF_KIND_ENUM

Currently, BTF_KIND_ENUM type doesn't record whether enum values should be
interpreted as signed or unsigned. In Linux, most enums are unsigned, though,
so interpreting them as unsigned matches real world better.

Change btf_dump test case to test maximum 32-bit value, instead of negative
value.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200303003233.3496043-3-andriin@fb.com
tools/lib/bpf/btf_dump.c
tools/testing/selftests/bpf/progs/btf_dump_test_case_syntax.c