diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-17 15:55:35 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-18 12:23:33 +0000 |
commit | b064ba9c3cfaf3d22d6153ec3c245eaa4d913674 (patch) | |
tree | 3f76755a82c18f25a1ad11a16f4baeb63c4a3053 /include | |
parent | ae6084b739925d84ef4a481d8eaa2187455f2e2f (diff) |
af_unix: preserve const qualifier in unix_sk()
We can change unix_sk() to propagate its argument const qualifier,
thanks to container_of_const().
We need to change dump_common_audit_data() 'struct unix_sock *u'
local var to get a const attribute.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/af_unix.h | 5 |
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 |