[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230317155539.2552954-8-edumazet@google.com>
Date: Fri, 17 Mar 2023 15:55:36 +0000
From: Eric Dumazet <edumazet@...gle.com>
To: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, David Ahern <dsahern@...nel.org>,
Simon Horman <simon.horman@...igine.com>,
Willem de Bruijn <willemb@...gle.com>,
Matthieu Baerts <matthieu.baerts@...sares.net>,
eric.dumazet@...il.com, Eric Dumazet <edumazet@...gle.com>,
Karsten Graul <kgraul@...ux.ibm.com>,
Wenjia Zhang <wenjia@...ux.ibm.com>,
Jan Karcher <jaka@...ux.ibm.com>
Subject: [PATCH net-next 07/10] 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@...gle.com>
Cc: Karsten Graul <kgraul@...ux.ibm.com>
Cc: Wenjia Zhang <wenjia@...ux.ibm.com>
Cc: Jan Karcher <jaka@...ux.ibm.com>
---
net/smc/smc.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/smc/smc.h b/net/smc/smc.h
index 5ed765ea0c731a7f0095cd6a99a0e42d227eaca9..2eeea4cdc7187eed2a3b12888d8f647382f6f2ac 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)
{
--
2.40.0.rc2.332.ga46443480c-goog
Powered by blists - more mailing lists