Thread (6 messages) flat view 6 messages, 2 authors, 2021-08-12
STALE1839d

[PATCH iproute2] lib: bpf_glue: remove useless assignment

From: Andrea Claudi <hidden>
Date: 2021-08-07 17:00:39
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

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

Signed-off-by: Andrea Claudi <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help