netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] lib/bpf_legacy: remove always-true check
@ 2021-11-16 19:32 Maxim Petrov
  0 siblings, 0 replies; only message in thread
From: Maxim Petrov @ 2021-11-16 19:32 UTC (permalink / raw)
  To: netdev, stephen

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>
---
 lib/bpf_legacy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/bpf_legacy.c b/lib/bpf_legacy.c
index 3bf08a09..6e3891c9 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)));
-- 
2.25.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-16 19:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 19:32 [PATCH iproute2] lib/bpf_legacy: remove always-true check Maxim Petrov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).