summaryrefslogtreecommitdiff
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-10-26 09:37:11 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-10-26 17:24:05 +0100
commitb7eec52bcb7ab93a8cce0f718f42fa17d6d91745 (patch)
tree1eaa4b7ad5d5c90a584ae9db7248b48bb5312a32 /net/mac802154
parentcfa626cb3725101fd1853c2cab857aabfd78274b (diff)
mac802154: tx: cleanup crc calculation
Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/tx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c
index d39c7d946bc3..70fd22632cf6 100644
--- a/net/mac802154/tx.c
+++ b/net/mac802154/tx.c
@@ -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))