Skip to content

Commit 6c59ebd

Browse files
geliangtangdavem330
authored andcommitted
sock: use hlist_entry_safe
Use hlist_entry_safe() instead of open-coding it. Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c10aa71 commit 6c59ebd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

include/net/sock.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,7 @@ static inline struct sock *sk_nulls_head(const struct hlist_nulls_head *head)
544544

545545
static inline struct sock *sk_next(const struct sock *sk)
546546
{
547-
return sk->sk_node.next ?
548-
hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL;
547+
return hlist_entry_safe(sk->sk_node.next, struct sock, sk_node);
549548
}
550549

551550
static inline struct sock *sk_nulls_next(const struct sock *sk)

0 commit comments

Comments
 (0)