summaryrefslogtreecommitdiff
path: root/include/net/ax25.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-03-17 15:55:37 +0000
committerDavid S. Miller <davem@davemloft.net>2023-03-18 12:23:34 +0000
commitc7154ca8e075cc456fe773879263b33ae307a59e (patch)
tree03299ad254607977d7fa595e83ea599da98798b2 /include/net/ax25.h
parent407db475d505d5aa4c2352b80e429a02f5ccd1e4 (diff)
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>
Diffstat (limited to 'include/net/ax25.h')
-rw-r--r--include/net/ax25.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h
index f8cf3629a419..0d939e5aee4e 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -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)
{