Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrea Claudi <aclaudi@redhat.com>
To: netdev@vger.kernel.org
Cc: stephen@networkplumber.org, dsahern@gmail.com, haliu@redhat.com
Subject: [PATCH iproute2] lib: bpf_glue: remove useless assignment
Date: Sat,  7 Aug 2021 18:58:02 +0200	[thread overview]
Message-ID: <25ea92f064e11ba30ae696b176df9d6b0aaaa66a.1628352013.git.aclaudi@redhat.com> (raw)

The value of s used inside the cycle is the result of strstr(), so this
assignment is useless.

Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
 lib/bpf_glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bpf_glue.c b/lib/bpf_glue.c
index eaa9504f..70d00184 100644
--- a/lib/bpf_glue.c
+++ b/lib/bpf_glue.c
@@ -63,7 +63,7 @@ const char *get_libbpf_version(void)
 	if (fp == NULL)
 		goto out;
 
-	while ((s = fgets(buf, sizeof(buf), fp)) != NULL) {
+	while (fgets(buf, sizeof(buf), fp) != NULL) {
 		if ((s = strstr(buf, "libbpf.so.")) != NULL) {
 			strncpy(_libbpf_version, s+10, sizeof(_libbpf_version)-1);
 			strtok(_libbpf_version, "\n");
-- 
2.31.1


             reply	other threads:[~2021-08-07 17:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 16:58 Andrea Claudi [this message]
2021-08-11  3:00 ` Stephen Hemminger
2021-08-11  9:12   ` Andrea Claudi
2021-08-11 16:08     ` Stephen Hemminger
2021-08-12  9:01       ` Andrea Claudi
2021-08-12 16:26         ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25ea92f064e11ba30ae696b176df9d6b0aaaa66a.1628352013.git.aclaudi@redhat.com \
    --to=aclaudi@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=haliu@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --subject='Re: [PATCH iproute2] lib: bpf_glue: remove useless assignment' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).