Skip to content

Commit 407db47

Browse files
edumazetdavem330
authored andcommitted
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]>
1 parent b064ba9 commit 407db47

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)