Merge tag 'staging-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux-2.6-block.git] / drivers / staging / rtl8192u / ieee80211 / ieee80211_crypt_tkip.c
index d67bb57994c416531a50cc1c86c876cdb3dc12ce..0927b2b15151f69d8887e572b02e48967cb81d32 100644 (file)
@@ -1,12 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Host AP crypt: host-based TKIP encryption implementation for Host AP driver
  *
  * Copyright (c) 2003-2004, Jouni Malinen <jkmaline@cc.hut.fi>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation. See README and COPYING for
- * more details.
  */
 
 #include <linux/module.h>
@@ -331,7 +327,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
                *pos++ = rc4key[2];
        }
 
-       *pos++ = (tkey->key_idx << 6) | (1 << 5) /* Ext IV included */;
+       *pos++ = (tkey->key_idx << 6) | BIT(5) /* Ext IV included */;
        *pos++ = tkey->tx_iv32 & 0xff;
        *pos++ = (tkey->tx_iv32 >> 8) & 0xff;
        *pos++ = (tkey->tx_iv32 >> 16) & 0xff;
@@ -390,7 +386,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        pos = skb->data + hdr_len;
        keyidx = pos[3];
-       if (!(keyidx & (1 << 5))) {
+       if (!(keyidx & BIT(5))) {
                if (net_ratelimit()) {
                        printk(KERN_DEBUG "TKIP: received packet without ExtIV"
                               " flag from %pM\n", hdr->addr2);