Skip to content

Commit b7eec52

Browse files
alexaringholtmann
authored andcommitted
mac802154: tx: cleanup crc calculation
Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent cfa626c commit b7eec52

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

net/mac802154/tx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,9 @@ mac802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
8484
mac802154_monitors_rx(local, skb);
8585

8686
if (!(local->hw.flags & IEEE802154_HW_OMIT_CKSUM)) {
87-
u16 crc = crc_ccitt(0, skb->data, skb->len);
88-
u8 *data = skb_put(skb, 2);
87+
__le16 crc = cpu_to_le16(crc_ccitt(0, skb->data, skb->len));
8988

90-
data[0] = crc & 0xff;
91-
data[1] = crc >> 8;
89+
memcpy(skb_put(skb, 2), &crc, 2);
9290
}
9391

9492
if (skb_cow_head(skb, local->hw.extra_tx_headroom))

0 commit comments

Comments
 (0)