diff options
author | Ben Dooks <ben.dooks@codethink.co.uk> | 2018-11-14 12:50:21 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-17 05:16:19 +0100 |
commit | 6809d2167c404c2c8cbbbe1667c70ea88576ccac (patch) | |
tree | 3b502a77a0279b135148124a6c386aeff6cccf3a /drivers/net/usb/smsc95xx.c | |
parent | usbnet: smsc95xx: simplify tx_fixup code (diff) | |
download | linux-6809d2167c404c2c8cbbbe1667c70ea88576ccac.tar.xz linux-6809d2167c404c2c8cbbbe1667c70ea88576ccac.zip |
usbnet: smsc95xx: fix memcpy for accessing rx-data
Change the RX code to use get_unaligned_le32() instead of the combo
of memcpy and cpu_to_le32s(&var).
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/smsc95xx.c')
-rw-r--r-- | drivers/net/usb/smsc95xx.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 924ca94d3495..a50cb9fd10fb 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -618,9 +618,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb) return; } - memcpy(&intdata, urb->transfer_buffer, 4); - le32_to_cpus(&intdata); - + intdata = get_unaligned_le32(urb->transfer_buffer); netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); if (intdata & INT_ENP_PHY_INT_) @@ -1934,8 +1932,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) unsigned char *packet; u16 size; - memcpy(&header, skb->data, sizeof(header)); - le32_to_cpus(&header); + header = get_unaligned_le32(skb->data); skb_pull(skb, 4 + NET_IP_ALIGN); packet = skb->data; |