Commit 5864118b authored by Chuhong Yuan's avatar Chuhong Yuan Committed by David S. Miller

usbnet: smsc75xx: Merge memcpy + le32_to_cpus to get_unaligned_le32

Merge the combo use of memcpy and le32_to_cpus.
Use get_unaligned_le32 instead.
This simplifies the code.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb448f8a
...@@ -661,8 +661,7 @@ static void smsc75xx_status(struct usbnet *dev, struct urb *urb) ...@@ -661,8 +661,7 @@ static void smsc75xx_status(struct usbnet *dev, struct urb *urb)
return; return;
} }
memcpy(&intdata, urb->transfer_buffer, 4); intdata = get_unaligned_le32(urb->transfer_buffer);
le32_to_cpus(&intdata);
netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata); netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata);
...@@ -2181,12 +2180,10 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) ...@@ -2181,12 +2180,10 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
struct sk_buff *ax_skb; struct sk_buff *ax_skb;
unsigned char *packet; unsigned char *packet;
memcpy(&rx_cmd_a, skb->data, sizeof(rx_cmd_a)); rx_cmd_a = get_unaligned_le32(skb->data);
le32_to_cpus(&rx_cmd_a);
skb_pull(skb, 4); skb_pull(skb, 4);
memcpy(&rx_cmd_b, skb->data, sizeof(rx_cmd_b)); rx_cmd_b = get_unaligned_le32(skb->data);
le32_to_cpus(&rx_cmd_b);
skb_pull(skb, 4 + RXW_PADDING); skb_pull(skb, 4 + RXW_PADDING);
packet = skb->data; packet = skb->data;
......
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