]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Poison kernel-only integer types
authorAndrii Nakryiko <andriin@fb.com>
Fri, 10 Jan 2020 18:19:16 +0000 (10:19 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 10 Jan 2020 18:38:00 +0000 (10:38 -0800)
commitd60ff7938501b84f83b7e3dfe591e104c26257ee
treea5dd199f093ed5cd8a2dd179c2682ea5520b26b5
parent97950432a25d0075ed219d1df86a0eeccd94d157
libbpf: Poison kernel-only integer types

It's been a recurring issue with types like u32 slipping into libbpf source
code accidentally. This is not detected during builds inside kernel source
tree, but becomes a compilation error in libbpf's Github repo. Libbpf is
supposed to use only __{s,u}{8,16,32,64} typedefs, so poison {s,u}{8,16,32,64}
explicitly in every .c file. Doing that in a bit more centralized way, e.g.,
inside libbpf_internal.h breaks selftests, which are both using kernel u32 and
libbpf_internal.h.

This patch also fixes a new u32 occurence in libbpf.c, added recently.

Fixes: cccbac39360c ("bpf: libbpf: Add STRUCT_OPS support")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200110181916.271446-1-andriin@fb.com
12 files changed:
tools/lib/bpf/bpf.c
tools/lib/bpf/bpf_prog_linfo.c
tools/lib/bpf/btf.c
tools/lib/bpf/btf_dump.c
tools/lib/bpf/hashmap.c
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf_errno.c
tools/lib/bpf/libbpf_probes.c
tools/lib/bpf/netlink.c
tools/lib/bpf/nlattr.c
tools/lib/bpf/str_error.c
tools/lib/bpf/xsk.c