Skip to contentSkip to conversation

net: decnet: af_decnet: Simplify goto loop.

PATCH Applied Suraj Upadhyay 2 participants 2 messages Jul 16, 2020 – Jul 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: decnet: af_decnet: Simplify goto loop.

Replace goto loop with while loop.

---
 net/decnet/af_decnet.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
net/decnet/af_decnet.c +5 -8
index 0a46ea3bddd5..7d7ae2dd69b8 100644
@@ -2134,14 +2134,11 @@ static struct sock *dn_socket_get_next(struct seq_file *seq,
 	struct dn_iter_state *state = seq->private;
 
 	n = sk_next(n);
-try_again:
-	if (n)
-		goto out;
-	if (++state->bucket >= DN_SK_HASH_SIZE)
-		goto out;
-	n = sk_head(&dn_sk_hash[state->bucket]);
-	goto try_again;
-out:
+	while (!n) {
+		if (++state->bucket >= DN_SK_HASH_SIZE)
+			break;
+		n = sk_head(&dn_sk_hash[state->bucket]);
+	}
 	return n;
 }
 
Signature · 1 line
2.17.1