mac802154: tx: cleanup crc calculation
authorAlexander Aring <alex.aring@gmail.com>
Sun, 26 Oct 2014 08:37:11 +0000 (09:37 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 26 Oct 2014 16:24:05 +0000 (17:24 +0100)
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/mac802154/tx.c

index d39c7d946bc38c7f73561ea7c0e3c63043f937c8..70fd22632cf659dba7fbf06b0dab3d065fb6fb57 100644 (file)
@@ -84,11 +84,9 @@ mac802154_tx(struct ieee802154_local *local, struct sk_buff *skb)
        mac802154_monitors_rx(local, skb);
 
        if (!(local->hw.flags & IEEE802154_HW_OMIT_CKSUM)) {
-               u16 crc = crc_ccitt(0, skb->data, skb->len);
-               u8 *data = skb_put(skb, 2);
+               __le16 crc = cpu_to_le16(crc_ccitt(0, skb->data, skb->len));
 
-               data[0] = crc & 0xff;
-               data[1] = crc >> 8;
+               memcpy(skb_put(skb, 2), &crc, 2);
        }
 
        if (skb_cow_head(skb, local->hw.extra_tx_headroom))