Skip to content

Commit

Permalink
sctp: preserve const qualifier in sctp_sk()
Browse files Browse the repository at this point in the history
We can change sctp_sk() to propagate its argument const qualifier,
thanks to container_of_const().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Cc: Xin Long <lucien.xin@gmail.com>
Acked-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 5, 2024
1 parent ffabe98 commit 89304f9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 89304f9

Please sign in to comment.