diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2017-03-24 10:08:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-24 20:49:30 -0700 |
commit | 2b5cd0dfa384242f78a396b90087368c9440cc9a (patch) | |
tree | aba02503d7405e225fe590248127028e10cafd8c /net/core/datagram.c | |
parent | d2e64dbbe95b2b51eb723134274de1d3f30bce80 (diff) | |
download | op-kernel-dev-2b5cd0dfa384242f78a396b90087368c9440cc9a.zip op-kernel-dev-2b5cd0dfa384242f78a396b90087368c9440cc9a.tar.gz |
net: Change return type of sk_busy_loop from bool to void
checking the return value of sk_busy_loop. As there are only a few
consumers of that data, and the data being checked for can be replaced
with a check for !skb_queue_empty() we might as well just pull the code
out of sk_busy_loop and place it in the spots that actually need it.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/datagram.c')
-rw-r--r-- | net/core/datagram.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c index ea63334..4608aa2 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -256,8 +256,12 @@ struct sk_buff *__skb_try_recv_datagram(struct sock *sk, unsigned int flags, } spin_unlock_irqrestore(&queue->lock, cpu_flags); - } while (sk_can_busy_loop(sk) && - sk_busy_loop(sk, flags & MSG_DONTWAIT)); + + if (!sk_can_busy_loop(sk)) + break; + + sk_busy_loop(sk, flags & MSG_DONTWAIT); + } while (!skb_queue_empty(&sk->sk_receive_queue)); error = -EAGAIN; |