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>
This commit is contained in:

committed by
David S. Miller

parent
c10aa71b9d
commit
6c59ebd356
@@ -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)
|
static inline struct sock *sk_next(const struct sock *sk)
|
||||||
{
|
{
|
||||||
return sk->sk_node.next ?
|
return hlist_entry_safe(sk->sk_node.next, struct sock, sk_node);
|
||||||
hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct sock *sk_nulls_next(const struct sock *sk)
|
static inline struct sock *sk_nulls_next(const struct sock *sk)
|
||||||
|
Reference in New Issue
Block a user