summaryrefslogtreecommitdiff
path: root/net/decnet
diff options
context:
space:
mode:
authorSuraj Upadhyay <usuraj35@gmail.com>2020-07-16 22:16:45 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-17 22:56:11 +0300
commite0c3f4c4fdc0648cffedd5e70f16be7ab45340b4 (patch)
treec9f2e4e68aff001f4e77a6cfd32d80e4adcd9b17 /net/decnet
parentc4fefd5a33d45fc5f0f3775b367aa129813584e0 (diff)
downloadlinux-e0c3f4c4fdc0648cffedd5e70f16be7ab45340b4.tar.xz
net: decnet: af_decnet: Simplify goto loop.
Replace goto loop with while loop. Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/af_decnet.c13
1 files 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;
}