linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: decnet: af_decnet: Simplify goto loop.
@ 2020-07-16 19:16 Suraj Upadhyay
  2020-07-17 19:56 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Suraj Upadhyay @ 2020-07-16 19:16 UTC (permalink / raw)
  To: davem, kuba; +Cc: linux-decnet-user, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

Replace goto loop with while loop.

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
---
 net/decnet/af_decnet.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 0a46ea3bddd5..7d7ae2dd69b8 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -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;
 }
 
-- 
2.17.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] net: decnet: af_decnet: Simplify goto loop.
  2020-07-16 19:16 [PATCH] net: decnet: af_decnet: Simplify goto loop Suraj Upadhyay
@ 2020-07-17 19:56 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-07-17 19:56 UTC (permalink / raw)
  To: usuraj35; +Cc: kuba, linux-decnet-user, netdev, linux-kernel

From: Suraj Upadhyay <usuraj35@gmail.com>
Date: Fri, 17 Jul 2020 00:46:45 +0530

> Replace goto loop with while loop.
> 
> Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>

Applied to net-next.

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

end of thread, other threads:[~2020-07-17 19:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 19:16 [PATCH] net: decnet: af_decnet: Simplify goto loop Suraj Upadhyay
2020-07-17 19:56 ` David Miller

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