From: Alexander Lobakin Date: Sun, 14 Mar 2021 11:11:14 +0000 (+0000) Subject: skbuff: make __skb_header_pointer()'s data argument const X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e3305138da47f0ae2241e5daa18af276e1e54457;p=linux.git 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 Signed-off-by: David S. Miller --- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 483e89348f78b..d6ea3dc3eddb2 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)