Skip to contentSkip to conversation

netlink: use container_of instead

PATCH In review Denis Cheng 2 participants 2 messages Aug 28, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netlink: use container_of instead

this could make future redesign of struct netlink_sock easier.

---
 net/netlink/af_netlink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netlink/af_netlink.c +1 -1
index 5681ce3..a78d962 100644
@@ -88,7 +88,7 @@ struct netlink_sock {
 
 static inline struct netlink_sock *nlk_sk(struct sock *sk)
 {
-	return (struct netlink_sock *)sk;
+	return container_of(sk, struct netlink_sock, sk);
 }
 
 struct nl_pid_hash {
Signature · 1 line
1.5.3.rc5