Commit 96339d6c authored by Shan Wei's avatar Shan Wei Committed by David S. Miller

net:use help function of skb_checksum_start_offset to calculate offset

Although these are equivalent, but the skb_checksum_start_offset() is more readable.
Signed-off-by: default avatarShan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f6d8bd05
...@@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
unsigned int len = skb->len; unsigned int len = skb->len;
unsigned char *data = skb->data; unsigned char *data = skb->data;
unsigned int csum_start = skb->csum_start - skb_headroom(skb); unsigned int csum_start = skb_checksum_start_offset(skb);
lepp_frag_t frags[LEPP_MAX_FRAGS]; lepp_frag_t frags[LEPP_MAX_FRAGS];
......
...@@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features) ...@@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
/* Do software UFO. Complete and fill in the UDP checksum as HW cannot /* Do software UFO. Complete and fill in the UDP checksum as HW cannot
* do checksum of UDP packets sent as multiple IP fragments. * do checksum of UDP packets sent as multiple IP fragments.
*/ */
offset = skb->csum_start - skb_headroom(skb); offset = skb_checksum_start_offset(skb);
csum = skb_checksum(skb, offset, skb->len- offset, 0); csum = skb_checksum(skb, offset, skb->len- offset, 0);
offset += skb->csum_offset; offset += skb->csum_offset;
*(__sum16 *)(skb->data + offset) = csum_fold(csum); *(__sum16 *)(skb->data + offset) = csum_fold(csum);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment