aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dumazet <[email protected]>2023-03-17 15:55:34 +0000
committerDavid S. Miller <[email protected]>2023-03-18 12:23:33 +0000
commitae6084b739925d84ef4a481d8eaa2187455f2e2f (patch)
treed60273261620511a0ea81e19851b4399952d1012
parent47fcae28b9ec409423ba7f67f93e8345acce8a36 (diff)
dccp: preserve const qualifier in dccp_sk()
We can change dccp_sk() to propagate its argument const qualifier, thanks to container_of_const(). Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--include/linux/dccp.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 07e547c02fd8..325af611909f 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -305,10 +305,8 @@ struct dccp_sock {
struct timer_list dccps_xmit_timer;
};
-static inline struct dccp_sock *dccp_sk(const struct sock *sk)
-{
- return (struct dccp_sock *)sk;
-}
+#define dccp_sk(ptr) container_of_const(ptr, struct dccp_sock, \
+ dccps_inet_connection.icsk_inet.sk)
static inline const char *dccp_role(const struct sock *sk)
{