diff mbox series

[11/12] wifi: cw1200: use get_unaligned_le64()

Message ID 20220904212910.a5c9ea122f0f.If786a66f8fd9d45659cd5a2532cf395e21334453@changeid (mailing list archive)
State Accepted
Commit 53b17c121f29d6bf8547f8823650a8d134e7afb6
Delegated to: Kalle Valo
Headers show
Series [01/12] wifi: ipw2100: fix warnings about non-kernel-doc | expand

Commit Message

Johannes Berg Sept. 4, 2022, 7:29 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Instead of the code here that copies into a variable
first and then flips endianness, which confuses sparse,
just directly use get_unaligned_le64().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
Cc: Solomon Peachy <pizza@shaftnet.org>

---
 drivers/net/wireless/st/cw1200/txrx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/st/cw1200/txrx.c b/drivers/net/wireless/st/cw1200/txrx.c
index ab19e0403dc2..6894b919ff94 100644
--- a/drivers/net/wireless/st/cw1200/txrx.c
+++ b/drivers/net/wireless/st/cw1200/txrx.c
@@ -1142,8 +1142,7 @@  void cw1200_rx_cb(struct cw1200_common *priv,
 
 	/* Remove TSF from the end of frame */
 	if (arg->flags & WSM_RX_STATUS_TSF_INCLUDED) {
-		memcpy(&hdr->mactime, skb->data + skb->len - 8, 8);
-		hdr->mactime = le64_to_cpu(hdr->mactime);
+		hdr->mactime = get_unaligned_le64(skb->data + skb->len - 8);
 		if (skb->len >= 8)
 			skb_trim(skb, skb->len - 8);
 	} else {