mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
47fcae28b9
commit
ae6084b739
1 changed files with 2 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue