projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dac06b3
)
skbuff: make __skb_header_pointer()'s data argument const
author
Alexander Lobakin
<alobakin@pm.me>
Sun, 14 Mar 2021 11:11:14 +0000
(11:11 +0000)
committer
David S. Miller
<davem@davemloft.net>
Sun, 14 Mar 2021 21:46:32 +0000
(14:46 -0700)
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>
include/linux/skbuff.h
patch
|
blob
|
history
diff --git
a/include/linux/skbuff.h
b/include/linux/skbuff.h
index 483e89348f78b48235748de37ae3ea7ec9450491..d6ea3dc3eddb2793d51530230f89faa7feacff58 100644
(file)
--- 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)