]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ax88179_178a: Merge memcpy + le32_to_cpus to get_unaligned_le32
authorChuhong Yuan <hslester96@gmail.com>
Fri, 19 Jul 2019 09:07:15 +0000 (17:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jul 2019 19:12:58 +0000 (12:12 -0700)
Merge the combo use of memcpy and le32_to_cpus.
Use get_unaligned_le32 instead.
This simplifies the code.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/ax88179_178a.c

index 0bc457ba8574a79838bcbc2ecb29bb611ac5cfb3..72d165114b674fdc8629e8f7d00af80cde67dca9 100644 (file)
@@ -1366,8 +1366,7 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
                return 0;
 
        skb_trim(skb, skb->len - 4);
-       memcpy(&rx_hdr, skb_tail_pointer(skb), 4);
-       le32_to_cpus(&rx_hdr);
+       rx_hdr = get_unaligned_le32(skb_tail_pointer(skb));
 
        pkt_cnt = (u16)rx_hdr;
        hdr_off = (u16)(rx_hdr >> 16);