diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-16 16:31:55 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-17 09:56:37 +0100 |
commit | abc17a11ed29b0471e428d86189acca8d1a213c6 (patch) | |
tree | da8ab312279911b367d333f13e1880dfd3c30386 /include/trace/events | |
parent | netlink: specs: allow uapi-header in genetlink (diff) | |
download | linux-abc17a11ed29b0471e428d86189acca8d1a213c6.tar.xz linux-abc17a11ed29b0471e428d86189acca8d1a213c6.zip |
inet: preserve const qualifier in inet_sk()
We can change inet_sk() to propagate const qualifier of its argument.
This should avoid some potential errors caused by accidental
(const -> not_const) promotion.
Other helpers like tcp_sk(), udp_sk(), raw_sk() will be handled
in separate patch series.
v2: use container_of_const() as advised by Jakub and Linus
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/netdev/20230315142841.3a2ac99a@kernel.org/
Link: https://lore.kernel.org/netdev/CAHk-=wiOf12nrYEF2vJMcucKjWPN-Ns_SW9fA7LwST_2Dzp7rw@mail.gmail.com/
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/trace/events')
-rw-r--r-- | include/trace/events/sock.h | 4 | ||||
-rw-r--r-- | include/trace/events/tcp.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h index 03d19fc562f8..fd206a6ab5b8 100644 --- a/include/trace/events/sock.h +++ b/include/trace/events/sock.h @@ -158,7 +158,7 @@ TRACE_EVENT(inet_sock_set_state, ), TP_fast_assign( - struct inet_sock *inet = inet_sk(sk); + const struct inet_sock *inet = inet_sk(sk); struct in6_addr *pin6; __be32 *p32; @@ -222,7 +222,7 @@ TRACE_EVENT(inet_sk_error_report, ), TP_fast_assign( - struct inet_sock *inet = inet_sk(sk); + const struct inet_sock *inet = inet_sk(sk); struct in6_addr *pin6; __be32 *p32; diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h index 901b440238d5..bf06db8d2046 100644 --- a/include/trace/events/tcp.h +++ b/include/trace/events/tcp.h @@ -67,7 +67,7 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb, ), TP_fast_assign( - struct inet_sock *inet = inet_sk(sk); + const struct inet_sock *inet = inet_sk(sk); __be32 *p32; __entry->skbaddr = skb; |