Skip to contentSkip to conversation

ax88179_178a: Merge memcpy + le32_to_cpus to get_unaligned_le32

PATCH Applied Chuhong Yuan 2 participants 2 messages Jul 19, 2019 – Jul 22, 2019

Subsystems (4)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ax88179_178a: 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.

---
 drivers/net/usb/ax88179_178a.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/usb/ax88179_178a.c +1 -2
index 0bc457ba8574..72d165114b67 100644
@@ -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);
Signature · 1 line
2.20.1