x25: preserve const qualifier in [a]x25_sk()

We can change [a]x25_sk() to propagate their 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:
Eric Dumazet 2023-03-17 15:55:37 +00:00 committed by David S. Miller
parent 407db475d5
commit c7154ca8e0
2 changed files with 2 additions and 8 deletions

View File

@ -260,10 +260,7 @@ struct ax25_sock {
struct ax25_cb *cb; struct ax25_cb *cb;
}; };
static inline struct ax25_sock *ax25_sk(const struct sock *sk) #define ax25_sk(ptr) container_of_const(ptr, struct ax25_sock, sk)
{
return (struct ax25_sock *) sk;
}
static inline struct ax25_cb *sk_to_ax25(const struct sock *sk) static inline struct ax25_cb *sk_to_ax25(const struct sock *sk)
{ {

View File

@ -177,10 +177,7 @@ struct x25_forward {
atomic_t refcnt; atomic_t refcnt;
}; };
static inline struct x25_sock *x25_sk(const struct sock *sk) #define x25_sk(ptr) container_of_const(ptr, struct x25_sock, sk)
{
return (struct x25_sock *)sk;
}
/* af_x25.c */ /* af_x25.c */
extern int sysctl_x25_restart_request_timeout; extern int sysctl_x25_restart_request_timeout;