Commit ae6084b7 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47fcae28
...@@ -305,10 +305,8 @@ struct dccp_sock { ...@@ -305,10 +305,8 @@ struct dccp_sock {
struct timer_list dccps_xmit_timer; struct timer_list dccps_xmit_timer;
}; };
static inline struct dccp_sock *dccp_sk(const struct sock *sk) #define dccp_sk(ptr) container_of_const(ptr, struct dccp_sock, \
{ dccps_inet_connection.icsk_inet.sk)
return (struct dccp_sock *)sk;
}
static inline const char *dccp_role(const struct sock *sk) static inline const char *dccp_role(const struct sock *sk)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment