sctp: preserve const qualifier in sctp_sk()
Subsystems (3)
PATCH 1/1 sctp: preserve const qualifier in sctp_sk()
We can change sctp_sk() to propagate its argument const qualifier, thanks to container_of_const().
Signed-off-by Eric Dumazet <[email protected]>
Cc Marcelo Ricardo Leitner <[email protected]>
Cc Xin Long <[email protected]>
--- include/net/sctp/structs.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
include/net/sctp/structs.h +1 -4
@@ -242,10 +242,7 @@ struct sctp_sock {int do_auto_asconf; }; -static inline struct sctp_sock *sctp_sk (const struct sock *sk) -{ -return (struct sctp_sock *)sk; -} +#define sctp_sk (ptr) container_of_const(ptr, struct sctp_sock, inet.sk)static inline struct sock *sctp_opt2sk (const struct sctp_sock *sp) {
Signature · 1 line
2.43.0.594.gd9cf4e227d-goog
Quoted 7 lines · Eric Dumazet
We can change
sctp_sk()to propagate its argument const qualifier, thanks tocontainer_of_const().Signed-off-by Eric Dumazet <[email protected]>Cc Marcelo Ricardo Leitner <[email protected]>Cc Xin Long <[email protected]>
Acked-by Xin Long <[email protected]>
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:
Quoted 8 lines · On Fri, 2 Feb 2024 10:14:03 +0000 you wrote:
We can change
sctp_sk()to propagate its argument const qualifier, thanks tocontainer_of_const().Signed-off-by Eric Dumazet <[email protected]>Cc Marcelo Ricardo Leitner <[email protected]>Cc Xin Long <[email protected]>[...]
Here is the summary with links:
- [net-next] sctp: preserve const qualifier in sctp_sk()
https://git.kernel.org/netdev/net-next/c/89304f91bf8e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html