Commit 9f383969 authored by Payal Kshirsagar's avatar Payal Kshirsagar Committed by Greg Kroah-Hartman

staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.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: default avatarPayal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 93610762
...@@ -216,7 +216,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -216,7 +216,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
*pos++ = key->tx_pn[5]; *pos++ = key->tx_pn[5];
*pos++ = key->tx_pn[4]; *pos++ = key->tx_pn[4];
*pos++ = 0; *pos++ = 0;
*pos++ = (key->key_idx << 6) | (1 << 5) /* Ext IV included */; *pos++ = (key->key_idx << 6) | BIT(5) /* Ext IV included */;
*pos++ = key->tx_pn[3]; *pos++ = key->tx_pn[3];
*pos++ = key->tx_pn[2]; *pos++ = key->tx_pn[2];
*pos++ = key->tx_pn[1]; *pos++ = key->tx_pn[1];
...@@ -274,7 +274,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -274,7 +274,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
hdr = (struct rtl_80211_hdr_4addr *)skb->data; hdr = (struct rtl_80211_hdr_4addr *)skb->data;
pos = skb->data + hdr_len; pos = skb->data + hdr_len;
keyidx = pos[3]; keyidx = pos[3];
if (!(keyidx & (1 << 5))) { if (!(keyidx & BIT(5))) {
if (net_ratelimit()) { if (net_ratelimit()) {
netdev_dbg(skb->dev, "CCMP: received packet without ExtIV flag from %pM\n", netdev_dbg(skb->dev, "CCMP: received packet without ExtIV flag from %pM\n",
hdr->addr2); hdr->addr2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment