lib/bpf_legacy: remove always-true check

The 'name' field of the 'struct bpf_prog_info' is a plain C array. Thus, the
logical condition in bpf_dump_prog_info() is useless as the array address is
always true, so just remove it.

Signed-off-by: Maxim Petrov <mmrmaximuzz@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Maxim Petrov 2021-11-16 22:32:26 +03:00 committed by Stephen Hemminger
parent 79026c1262
commit 3184de3797
1 changed files with 1 additions and 3 deletions

View File

@ -203,9 +203,7 @@ int bpf_dump_prog_info(FILE *f, uint32_t id)
if (!ret && len) { if (!ret && len) {
int jited = !!info.jited_prog_len; int jited = !!info.jited_prog_len;
if (info.name) print_string(PRINT_ANY, "name", "name %s ", info.name);
print_string(PRINT_ANY, "name", "name %s ", info.name);
print_string(PRINT_ANY, "tag", "tag %s ", print_string(PRINT_ANY, "tag", "tag %s ",
hexstring_n2a(info.tag, sizeof(info.tag), hexstring_n2a(info.tag, sizeof(info.tag),
tmp, sizeof(tmp))); tmp, sizeof(tmp)));