Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ethernet: constify eth_get_headlen()'s data argument

It's used only for flow dissection, which now takes constant data
pointers.

Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexander Lobakin and committed by
David S. Miller
59753ce8 805a25f3

+2 -2
+1 -1
include/linux/etherdevice.h
··· 29 29 int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr); 30 30 unsigned char *arch_get_platform_mac_address(void); 31 31 int nvmem_get_mac_address(struct device *dev, void *addrbuf); 32 - u32 eth_get_headlen(const struct net_device *dev, void *data, unsigned int len); 32 + u32 eth_get_headlen(const struct net_device *dev, const void *data, u32 len); 33 33 __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); 34 34 extern const struct header_ops eth_header_ops; 35 35
+1 -1
net/ethernet/eth.c
··· 122 122 * Make a best effort attempt to pull the length for all of the headers for 123 123 * a given frame in a linear buffer. 124 124 */ 125 - u32 eth_get_headlen(const struct net_device *dev, void *data, unsigned int len) 125 + u32 eth_get_headlen(const struct net_device *dev, const void *data, u32 len) 126 126 { 127 127 const unsigned int flags = FLOW_DISSECTOR_F_PARSE_1ST_FRAG; 128 128 const struct ethhdr *eth = (const struct ethhdr *)data;