瀏覽代碼

[NETLINK]: use container_of instead

This could make future redesign of struct netlink_sock easier.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Denis Cheng 18 年之前
父節點
當前提交
32b21e034b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/netlink/af_netlink.c

+ 1 - 1
net/netlink/af_netlink.c

@@ -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 {