summaryrefslogtreecommitdiff
path: root/include/net/af_unix.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2023-03-18 12:23:48 +0000
committerDavid S. Miller <davem@davemloft.net>2023-03-18 12:23:48 +0000
commitdf28e8690e7126fa5c99e8863c27574204589f31 (patch)
treefd943e26281cfd7a7e0948d1949d6e0009c19510 /include/net/af_unix.h
parent39a86d059a78bf29b66dd8bbeab04af1d55c02ba (diff)
parente9d9da91548b21e189fcd0259a0f2d26d1afc509 (diff)
Merge branch 'net-better-const'
Eric Dumazet says: ==================== net: better const qualifier awareness This is a follow-up of d27d367d3b78 ("inet: better const qualifier awareness") Adopting container_of_const() to perform (struct sock *)->(protocol sock *) operation is allowing us to propagate const qualifier and thus detect misuses at compile time. Most conversions are trivial, because most protocols did not adopt yet const sk pointers where it could make sense. Only mptcp and tcp patches (end of this series) are requiring small adjustments. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/af_unix.h')
-rw-r--r--include/net/af_unix.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 45ebde587138..824c258143a3 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -74,10 +74,7 @@ struct unix_sock {
#endif
};
-static inline struct unix_sock *unix_sk(const struct sock *sk)
-{
- return (struct unix_sock *)sk;
-}
+#define unix_sk(ptr) container_of_const(ptr, struct unix_sock, sk)
#define peer_wait peer_wq.wait