Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <edumazet@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
ae6084b7 47fcae28

+2 -4
+2 -4
include/linux/dccp.h
··· 305 305 struct timer_list dccps_xmit_timer; 306 306 }; 307 307 308 - static inline struct dccp_sock *dccp_sk(const struct sock *sk) 309 - { 310 - return (struct dccp_sock *)sk; 311 - } 308 + #define dccp_sk(ptr) container_of_const(ptr, struct dccp_sock, \ 309 + dccps_inet_connection.icsk_inet.sk) 312 310 313 311 static inline const char *dccp_role(const struct sock *sk) 314 312 {