From: Maxim Petrov Date: Tue, 16 Nov 2021 19:32:26 +0000 (+0300) Subject: lib/bpf_legacy: remove always-true check X-Git-Tag: v5.16.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3184de37976c252a217f53953a439012363d8a6f;p=thirdparty%2Fiproute2.git 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 Signed-off-by: Stephen Hemminger --- diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c index 3bf08a09f..6e3891c9f 100644 --- a/lib/bpf_legacy.c +++ b/lib/bpf_legacy.c @@ -203,9 +203,7 @@ int bpf_dump_prog_info(FILE *f, uint32_t id) if (!ret && 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 ", hexstring_n2a(info.tag, sizeof(info.tag), tmp, sizeof(tmp)));