mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
udp: preserve const qualifier in udp_sk()
We can change udp_sk() to propagate const qualifier of its argument, thanks to container_of_const() This should avoid some potential errors caused by accidental (const -> not_const) promotion. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Willem de Bruijn <willemb@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
39a86d059a
commit
94c540fbfc
@ -97,10 +97,7 @@ struct udp_sock {
|
||||
|
||||
#define UDP_MAX_SEGMENTS (1 << 6UL)
|
||||
|
||||
static inline struct udp_sock *udp_sk(const struct sock *sk)
|
||||
{
|
||||
return (struct udp_sock *)sk;
|
||||
}
|
||||
#define udp_sk(ptr) container_of_const(ptr, struct udp_sock, inet.sk)
|
||||
|
||||
static inline void udp_set_no_check6_tx(struct sock *sk, bool val)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user