Skip to content

Commit

Permalink
net: decnet: af_decnet: Simplify goto loop.
Browse files Browse the repository at this point in the history
Replace goto loop with while loop.

Signed-off-by: Suraj Upadhyay <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Suraj-Upadhyay authored and davem330 committed Jul 17, 2020
1 parent c4fefd5 commit e0c3f4c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions net/decnet/af_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e0c3f4c

Please sign in to comment.