summaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2017-01-20 22:27:04 +0800
committerDavid S. Miller <davem@davemloft.net>2017-01-20 11:38:45 -0500
commit6c59ebd356ff2ca64cdf1f61c5fe17f6fa8fc045 (patch)
tree073b9b8d27b75b677ec94bd79a40eb0d695879d0 /include/net/sock.h
parentc10aa71b9d823603306a3bcd19f6c584bdf14ef7 (diff)
downloadtalos-op-linux-6c59ebd356ff2ca64cdf1f61c5fe17f6fa8fc045.tar.gz
talos-op-linux-6c59ebd356ff2ca64cdf1f61c5fe17f6fa8fc045.zip
sock: use hlist_entry_safe
Use hlist_entry_safe() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 389a0a619b45..7144750d14e5 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -544,8 +544,7 @@ static inline struct sock *sk_nulls_head(const struct hlist_nulls_head *head)
static inline struct sock *sk_next(const struct sock *sk)
{
- return sk->sk_node.next ?
- hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL;
+ return hlist_entry_safe(sk->sk_node.next, struct sock, sk_node);
}
static inline struct sock *sk_nulls_next(const struct sock *sk)
OpenPOWER on IntegriCloud