diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-22 10:41:34 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-23 06:44:14 +0300 |
commit | 7e24b4ed5ac4321e41415b0c6f0f8a8ac14852b2 (patch) | |
tree | d7766a24d4fbfbf1a00922984ad6c1f3ad4bf4cd /drivers/net/usb/ax88179_178a.c | |
parent | fcd4e60885af969d190999a6c42454c5578d52f1 (diff) | |
download | linux-7e24b4ed5ac4321e41415b0c6f0f8a8ac14852b2.tar.xz |
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>
Diffstat (limited to 'drivers/net/usb/ax88179_178a.c')
-rw-r--r-- | drivers/net/usb/ax88179_178a.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 72d165114b67..daa54486ab09 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -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; } |