aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
diff options
context:
space:
mode:
authorPayal Kshirsagar <payal.s.kshirsagar.98@gmail.com>2019-04-02 18:58:34 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-02 19:57:11 +0200
commit37b299c7c49acffa675c61018132e6de4f88a1ed (patch)
treea0f64221ded45db8439b409494441d73cebf749c /drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
parentstaging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: Replace bit shifting with BIT macro (diff)
downloadlinux-dev-37b299c7c49acffa675c61018132e6de4f88a1ed.tar.xz
linux-dev-37b299c7c49acffa675c61018132e6de4f88a1ed.zip
staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: Replace bit shifting with BIT macro
Challenge suggested by coccinelle. Prefer using BIT and replace bit shifting with the BIT(x) macro. Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c')
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 829fa4bd253c..320c179c9a4f 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -331,7 +331,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 +390,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);