mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
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:
parent
407db475d5
commit
c7154ca8e0
@ -260,10 +260,7 @@ struct ax25_sock {
|
||||
struct ax25_cb *cb;
|
||||
};
|
||||
|
||||
static inline struct ax25_sock *ax25_sk(const struct sock *sk)
|
||||
{
|
||||
return (struct ax25_sock *) sk;
|
||||
}
|
||||
#define ax25_sk(ptr) container_of_const(ptr, struct ax25_sock, sk)
|
||||
|
||||
static inline struct ax25_cb *sk_to_ax25(const struct sock *sk)
|
||||
{
|
||||
|
@ -177,10 +177,7 @@ struct x25_forward {
|
||||
atomic_t refcnt;
|
||||
};
|
||||
|
||||
static inline struct x25_sock *x25_sk(const struct sock *sk)
|
||||
{
|
||||
return (struct x25_sock *)sk;
|
||||
}
|
||||
#define x25_sk(ptr) container_of_const(ptr, struct x25_sock, sk)
|
||||
|
||||
/* af_x25.c */
|
||||
extern int sysctl_x25_restart_request_timeout;
|
||||
|
Loading…
Reference in New Issue
Block a user