public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] tipc: remove redundant assignment to ret, simplify code
@ 2024-04-11  9:17 Colin Ian King
  2024-04-11 10:04 ` Tung Quang Nguyen
  2024-04-13  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 8+ messages in thread
From: Colin Ian King @ 2024-04-11  9:17 UTC (permalink / raw)
  To: Jon Maloy, Ying Xue, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, tipc-discussion
  Cc: kernel-janitors, linux-kernel

Variable err is being assigned a zero value and it is never read
afterwards in either the break path or continue path, the assignment
is redundant and can be removed. With it removed, the if statement
can also be simplified.

Cleans up clang scan warning:
net/tipc/socket.c:3570:5: warning: Value stored to 'err' is never
read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 net/tipc/socket.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 7e4135db5816..798397b6811e 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -3565,11 +3565,8 @@ int tipc_nl_sk_walk(struct sk_buff *skb, struct netlink_callback *cb,
 	rhashtable_walk_start(iter);
 	while ((tsk = rhashtable_walk_next(iter)) != NULL) {
 		if (IS_ERR(tsk)) {
-			err = PTR_ERR(tsk);
-			if (err == -EAGAIN) {
-				err = 0;
+			if (PTR_ERR(tsk) == -EAGAIN)
 				continue;
-			}
 			break;
 		}
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-13  2:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11  9:17 [PATCH][next] tipc: remove redundant assignment to ret, simplify code Colin Ian King
2024-04-11 10:04 ` Tung Quang Nguyen
2024-04-11 10:31   ` Dan Carpenter
2024-04-11 10:43     ` Colin King (gmail)
2024-04-11 11:04       ` Tung Quang Nguyen
2024-04-11 11:27         ` Dan Carpenter
2024-04-11 11:42           ` Tung Quang Nguyen
2024-04-13  2:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox