diff options
author | Alexander Lobakin <alobakin@pm.me> | 2021-03-14 11:11:14 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-14 14:46:32 -0700 |
commit | e3305138da47f0ae2241e5daa18af276e1e54457 (patch) | |
tree | 49dc29cc415614d252f1c141cf64204057e5a06b /include/linux/skbuff.h | |
parent | dac06b32c705dc8824479b03eee826b4f6615ab2 (diff) |
skbuff: make __skb_header_pointer()'s data argument const
The function never modifies the input buffer, so 'data' argument
can be marked as const.
This implies one harmless cast-away.
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 483e89348f78..d6ea3dc3eddb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3678,11 +3678,11 @@ __wsum skb_checksum(const struct sk_buff *skb, int offset, int len, __wsum csum); static inline void * __must_check -__skb_header_pointer(const struct sk_buff *skb, int offset, - int len, void *data, int hlen, void *buffer) +__skb_header_pointer(const struct sk_buff *skb, int offset, int len, + const void *data, int hlen, void *buffer) { if (hlen - offset >= len) - return data + offset; + return (void *)data + offset; if (!skb || skb_copy_bits(skb, offset, buffer, len) < 0) |