diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-17 16:55:36 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-18 13:23:33 +0100 |
commit | 407db475d505d5aa4c2352b80e429a02f5ccd1e4 (patch) | |
tree | 76503f99b9d95f28999cff5d840fcf60414bba9d /net | |
parent | af_unix: preserve const qualifier in unix_sk() (diff) | |
download | linux-407db475d505d5aa4c2352b80e429a02f5ccd1e4.tar.xz linux-407db475d505d5aa4c2352b80e429a02f5ccd1e4.zip |
smc: preserve const qualifier in smc_sk()
We can change smc_sk() to propagate its argument const qualifier,
thanks to container_of_const().
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Karsten Graul <kgraul@linux.ibm.com>
Cc: Wenjia Zhang <wenjia@linux.ibm.com>
Cc: Jan Karcher <jaka@linux.ibm.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/smc/smc.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/smc/smc.h b/net/smc/smc.h index 5ed765ea0c73..2eeea4cdc718 100644 --- a/net/smc/smc.h +++ b/net/smc/smc.h @@ -283,10 +283,7 @@ struct smc_sock { /* smc sock container */ * */ }; -static inline struct smc_sock *smc_sk(const struct sock *sk) -{ - return (struct smc_sock *)sk; -} +#define smc_sk(ptr) container_of_const(ptr, struct smc_sock, sk) static inline void smc_init_saved_callbacks(struct smc_sock *smc) { |