From: Yuntao Wang Date: Sun, 20 Feb 2022 07:27:50 +0000 (+0800) Subject: libbpf: Remove redundant check in btf_fixup_datasec() X-Git-Tag: howlett/maple/20220722_2~938^2~185^2~23 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6966d4c4425b6796b1da13a6f86d09825df3d323;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220220072750.209215-1-ytcoode@gmail.com --- diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index ad43b6ce825e6..7e978feaf8225 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; }