tipc: remove redundant assignment to ret, simplify code
authorColin Ian King <colin.i.king@gmail.com>
Thu, 11 Apr 2024 09:17:04 +0000 (10:17 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Apr 2024 02:07:31 +0000 (19:07 -0700)
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>
Link: https://lore.kernel.org/r/20240411091704.306752-1-colin.i.king@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tipc/socket.c

index 7e4135db58163501e9ad011fa6c78975fbe53e75..798397b6811e1b88be3aee4c91abc2df4c46ed38 100644 (file)
@@ -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;
                }