Skip to content

Commit 2ecdc55

Browse files
ytcoodeNobody
authored andcommitted
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>
1 parent 3f6de57 commit 2ecdc55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2795,7 +2795,7 @@ static int btf_fixup_datasec(struct bpf_object *obj, struct btf *btf,
27952795
goto sort_vars;
27962796

27972797
ret = find_elf_sec_sz(obj, name, &size);
2798-
if (ret || !size || (t->size && t->size != size)) {
2798+
if (ret || !size) {
27992799
pr_debug("Invalid size for section %s: %u bytes\n", name, size);
28002800
return -ENOENT;
28012801
}

0 commit comments

Comments
 (0)