]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Simplify BTF initialization logic
authorAndrii Nakryiko <andriin@fb.com>
Fri, 17 Jan 2020 06:07:59 +0000 (22:07 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Jan 2020 16:33:18 +0000 (08:33 -0800)
commit0b3ed5ed48dc175f440850a05e42f6b266209af6
tree2eeca14116e1f2fdf5df051c0945109f6ced3e05
parenta3872be6d60f9a655f0d6053ed250bf30dbfaddf
libbpf: Simplify BTF initialization logic

Current implementation of bpf_object's BTF initialization is very convoluted
and thus prone to errors. It doesn't have to be like that. This patch
simplifies it significantly.

This code also triggered static analysis issues over logically dead code due
to redundant error checks. This simplification should fix that as well.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200117060801.1311525-3-andriin@fb.com
tools/lib/bpf/libbpf.c