net: usb: Merge cpu_to_le32s + memcpy to put_unaligned_le32
Merge the combo uses of cpu_to_le32s and memcpy. Use put_unaligned_le32 instead. This simplifies the code. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
fcd4e60885
commit
7e24b4ed5a
@@ -1421,6 +1421,7 @@ ax88179_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
|
||||
int frame_size = dev->maxpacket;
|
||||
int mss = skb_shinfo(skb)->gso_size;
|
||||
int headroom;
|
||||
void *ptr;
|
||||
|
||||
tx_hdr1 = skb->len;
|
||||
tx_hdr2 = mss;
|
||||
@@ -1435,13 +1436,9 @@ ax88179_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
skb_push(skb, 4);
|
||||
cpu_to_le32s(&tx_hdr2);
|
||||
skb_copy_to_linear_data(skb, &tx_hdr2, 4);
|
||||
|
||||
skb_push(skb, 4);
|
||||
cpu_to_le32s(&tx_hdr1);
|
||||
skb_copy_to_linear_data(skb, &tx_hdr1, 4);
|
||||
ptr = skb_push(skb, 8);
|
||||
put_unaligned_le32(tx_hdr1, ptr);
|
||||
put_unaligned_le32(tx_hdr2, ptr + 4);
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
Reference in New Issue
Block a user