Skip to content

Commit

Permalink
wifi: cw1200: use get_unaligned_le64()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/20220904212910.a5c9ea122f0f.If786a66f8fd9d45659cd5a2532cf395e21334453@changeid
  • Loading branch information
jmberg-intel authored and Kalle Valo committed Sep 7, 2022
1 parent df8e1af commit 53b17c1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/st/cw1200/txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 53b17c1

Please sign in to comment.