diff options
author | Geliang Tang <geliangtang@gmail.com> | 2017-01-20 09:27:04 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-20 11:38:45 -0500 |
commit | 6c59ebd356ff2ca64cdf1f61c5fe17f6fa8fc045 (patch) | |
tree | 073b9b8d27b75b677ec94bd79a40eb0d695879d0 /include/net/sock.h | |
parent | c10aa71b9d823603306a3bcd19f6c584bdf14ef7 (diff) |
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.h | 3 |
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) | |||
544 | 544 | ||
545 | static inline struct sock *sk_next(const struct sock *sk) | 545 | static inline struct sock *sk_next(const struct sock *sk) |
546 | { | 546 | { |
547 | return sk->sk_node.next ? | 547 | return hlist_entry_safe(sk->sk_node.next, struct sock, sk_node); |
548 | hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL; | ||
549 | } | 548 | } |
550 | 549 | ||
551 | static inline struct sock *sk_nulls_next(const struct sock *sk) | 550 | static inline struct sock *sk_nulls_next(const struct sock *sk) |