Commit c7154ca8 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: 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 407db475
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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)
{
+1 −4
Original line number Diff line number Diff line
@@ -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;