Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Dumazet and committed by
David S. Miller
407db475 b064ba9c

+1 -4
+1 -4
net/smc/smc.h
··· 283 283 * */ 284 284 }; 285 285 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) 290 287 291 288 static inline void smc_init_saved_callbacks(struct smc_sock *smc) 292 289 {