* [PATCH] sock: use hlist_entry_safe
@ 2017-01-20 14:27 Geliang Tang
2017-01-20 16:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Geliang Tang @ 2017-01-20 14:27 UTC (permalink / raw)
To: David S. Miller; +Cc: Geliang Tang, netdev, linux-kernel
Use hlist_entry_safe() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
include/net/sock.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index 4077ec4..c4e1caf1 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)
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sock: use hlist_entry_safe
2017-01-20 14:27 [PATCH] sock: use hlist_entry_safe Geliang Tang
@ 2017-01-20 16:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-01-20 16:39 UTC (permalink / raw)
To: geliangtang; +Cc: netdev, linux-kernel
From: Geliang Tang <geliangtang@gmail.com>
Date: Fri, 20 Jan 2017 22:27:04 +0800
> Use hlist_entry_safe() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-20 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-20 14:27 [PATCH] sock: use hlist_entry_safe Geliang Tang
2017-01-20 16:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).