[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <13f4d846-f2bf-4800-d9ca-4174b586de4b@linux.ibm.com>
Date: Fri, 17 Mar 2023 21:05:50 +0100
From: Wenjia Zhang <wenjia@...ux.ibm.com>
To: Eric Dumazet <edumazet@...gle.com>,
"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, Karsten Graul <kgraul@...ux.ibm.com>,
Jan Karcher <jaka@...ux.ibm.com>
Subject: Re: [PATCH net-next 07/10] smc: preserve const qualifier in smc_sk()
On 17.03.23 16:55, Eric Dumazet wrote:
> 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>
Reviewed-by: Wenjia Zhang <wenjia@...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)
> {
Powered by blists - more mailing lists