summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkinobu Mita <mita@miraclelinux.com>2006-04-28 15:21:23 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-04-29 18:33:15 -0700
commitda753beaeb1446aa87bcca7e8a0026633a8914f0 (patch)
tree910ca47bce30c4ef5df66c0d6545051f61d2d49e
parenta536e0778781c1f2ce38cf8e1d82ce258f0193c1 (diff)
[NET]: use hlist_unhashed()
Use hlist_unhashed() rather than accessing inside data structure. Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/list.h2
-rw-r--r--include/net/inet_timewait_sock.h2
-rw-r--r--include/net/sock.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 67258b47e9c..76f05718342 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -619,7 +619,7 @@ static inline void hlist_del_rcu(struct hlist_node *n)
static inline void hlist_del_init(struct hlist_node *n)
{
- if (n->pprev) {
+ if (!hlist_unhashed(n)) {
__hlist_del(n);
INIT_HLIST_NODE(n);
}
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 1da294c4752..e837f98fdb5 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -150,7 +150,7 @@ static inline void inet_twsk_add_bind_node(struct inet_timewait_sock *tw,
static inline int inet_twsk_dead_hashed(const struct inet_timewait_sock *tw)
{
- return tw->tw_death_node.pprev != NULL;
+ return !hlist_unhashed(&tw->tw_death_node);
}
static inline void inet_twsk_dead_node_init(struct inet_timewait_sock *tw)
diff --git a/include/net/sock.h b/include/net/sock.h
index ff8b0dad7b0..c9fad6fb629 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -279,7 +279,7 @@ static inline int sk_unhashed(const struct sock *sk)
static inline int sk_hashed(const struct sock *sk)
{
- return sk->sk_node.pprev != NULL;
+ return !sk_unhashed(sk);
}
static __inline__ void sk_node_init(struct hlist_node *node)