]> 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)
commit2844866e9ad21618d4f8d132953d38672fe74a3c
tree2eeca14116e1f2fdf5df051c0945109f6ced3e05
parent0f62007119d16c811f737f72bebcedb422f80fc7
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