]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
lib/bpf_legacy: remove always-true check
authorMaxim Petrov <mmrmaximuzz@gmail.com>
Tue, 16 Nov 2021 19:32:26 +0000 (22:32 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 18 Nov 2021 23:01:04 +0000 (15:01 -0800)
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>
lib/bpf_legacy.c

index 3bf08a09f876586d594302de96856abebf556fd9..6e3891c9f1f10bc8df4671301109f7e7a061dffe 100644 (file)
@@ -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)));