Skip to content

Commit 931a375

Browse files
author
Mete Durlu
committed
smc: preserve const qualifier in smc_sk()
JIRA: https://issues.redhat.com/browse/RHEL-73484 commit 407db47 Author: Eric Dumazet <[email protected]> Date: Fri Mar 17 15:55:36 2023 +0000 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 <[email protected]> Cc: Karsten Graul <[email protected]> Cc: Wenjia Zhang <[email protected]> Cc: Jan Karcher <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Wenjia Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Mete Durlu <[email protected]>
1 parent 21edbab commit 931a375

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

net/smc/smc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,7 @@ struct smc_sock { /* smc sock container */
283283
* */
284284
};
285285

286-
static inline struct smc_sock *smc_sk(const struct sock *sk)
287-
{
288-
return (struct smc_sock *)sk;
289-
}
286+
#define smc_sk(ptr) container_of_const(ptr, struct smc_sock, sk)
290287

291288
static inline void smc_init_saved_callbacks(struct smc_sock *smc)
292289
{

0 commit comments

Comments
 (0)