diff options
author | Yuntao Wang <ytcoode@gmail.com> | 2022-02-20 15:27:50 +0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-02-22 10:50:54 -0800 |
commit | 6966d4c4425b6796b1da13a6f86d09825df3d323 (patch) | |
tree | af62d392152f62a0ab2f4159acb8de38e64dfcb2 /tools/lib | |
parent | 13c6a37d409db9abc9c0bfc6d0a2f07bf0fff60e (diff) | |
download | linux-6966d4c4425b6796b1da13a6f86d09825df3d323.tar.bz2 |
libbpf: Remove redundant check in btf_fixup_datasec()
The check 't->size && t->size != size' is redundant because if t->size
compares unequal to 0, we will just skip straight to sorting variables.
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220220072750.209215-1-ytcoode@gmail.com
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/bpf/libbpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index ad43b6ce825e..7e978feaf822 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -2795,7 +2795,7 @@ static int btf_fixup_datasec(struct bpf_object *obj, struct btf *btf, goto sort_vars; ret = find_elf_sec_sz(obj, name, &size); - if (ret || !size || (t->size && t->size != size)) { + if (ret || !size) { pr_debug("Invalid size for section %s: %u bytes\n", name, size); return -ENOENT; } |