staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro
cover staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro
Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.
Payal Kshirsagar (3):
staging: rtl8192u: ieee80211: ieee80211_rx.c: Replace bit shifting
with BIT macro
staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: Replace bit
shifting with BIT macro
staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: Replace bit
shifting with BIT macro
.../rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 4 +-- .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 4 +-- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 32 +++++++++++----------- 3 files changed, 20 insertions(+), 20 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 staging: rtl8192u: ieee80211: ieee80211_rx.c: Replace bit shifting with BIT macro
Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +16 -16
@@ -2405,22 +2405,22 @@ static inline void ieee80211_process_probe_response("'%s' (%pM): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n" ,escape_essid (info_element->data, info_element->len), beacon->header.addr3, - (capability & (1 <<0xf )) ?'1' :'0' , - (capability & (1 <<0xe )) ?'1' :'0' , - (capability & (1 <<0xd )) ?'1' :'0' , - (capability & (1 <<0xc )) ?'1' :'0' , - (capability & (1 <<0xb )) ?'1' :'0' , - (capability & (1 <<0xa )) ?'1' :'0' , - (capability & (1 <<0x9 )) ?'1' :'0' , - (capability & (1 <<0x8 )) ?'1' :'0' , - (capability & (1 <<0x7 )) ?'1' :'0' , - (capability & (1 <<0x6 )) ?'1' :'0' , - (capability & (1 <<0x5 )) ?'1' :'0' , - (capability & (1 <<0x4 )) ?'1' :'0' , - (capability & (1 <<0x3 )) ?'1' :'0' , - (capability & (1 <<0x2 )) ?'1' :'0' , - (capability & (1 <<0x1 )) ?'1' :'0' , - (capability & (1 << 0x0)) ? '1' : '0'); + (capability &BIT (0xf )) ?'1' :'0' , + (capability &BIT (0xe )) ?'1' :'0' , + (capability &BIT (0xd )) ?'1' :'0' , + (capability &BIT (0xc )) ?'1' :'0' , + (capability &BIT (0xb )) ?'1' :'0' , + (capability &BIT (0xa )) ?'1' :'0' , + (capability &BIT (0x9 )) ?'1' :'0' , + (capability &BIT (0x8 )) ?'1' :'0' , + (capability &BIT (0x7 )) ?'1' :'0' , + (capability &BIT (0x6 )) ?'1' :'0' , + (capability &BIT (0x5 )) ?'1' :'0' , + (capability &BIT (0x4 )) ?'1' :'0' , + (capability &BIT (0x3 )) ?'1' :'0' , + (capability &BIT (0x2 )) ?'1' :'0' , + (capability &BIT (0x1 )) ?'1' :'0' , + (capability & BIT(0x0)) ? '1' : '0');if (ieee80211_network_init (ieee, beacon, network, stats)) { IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
Signature · 1 line
2.7.4
PATCH 2/3 staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: Replace bit shifting with BIT macro
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c +2 -2
@@ -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[4 ]; *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[2 ]; *pos++ = key->tx_pn[1 ];
@@ -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; pos = skb->data + hdr_len; keyidx = pos[3 ]; -if (!(keyidx & (1 <<5 ))) { +if (!(keyidx &BIT (5 ))) {if (net_ratelimit ()) {netdev_dbg (skb->dev,"CCMP: received packet without ExtIV flag from %pM\n" , hdr->addr2);
Signature · 1 line
2.7.4
PATCH 3/3 staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: Replace bit shifting with BIT macro
In reply to Payal KshirsagarChallenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.
--- drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +2 -2
@@ -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);
Signature · 1 line
2.7.4