summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorVatsala Narang <vatsalanarang@gmail.com>2019-04-26 11:42:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-30 16:03:42 +0300
commit8dd4305041250898bc1d664d0a285469073ed962 (patch)
tree327be89f311e44592b93b9b500129168b3164668 /drivers/staging
parent675c8a46a8cc8a15f64863fd4c7786df2b5b728b (diff)
downloadlinux-8dd4305041250898bc1d664d0a285469073ed962.tar.xz
staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro
Change suggested by coccinelle. Replace bit shifting on 1 with the BIT(x) macro. Coccinelle script: @@ expression c; @@ -(1 << c) +BIT(c) Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 90c7ab2189cc..644282ca4a9d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -71,7 +71,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
/* Add the protocol name */
iwe.cmd = SIOCGIWNAME;
for(i=0; i<ARRAY_SIZE(ieee80211_modes); i++) {
- if(network->mode&(1<<i)) {
+ if (network->mode & BIT(i)) {
sprintf(pname,ieee80211_modes[i].mode_string,ieee80211_modes[i].mode_size);
pname +=ieee80211_modes[i].mode_size;
}
@@ -379,7 +379,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
sec.key_sizes[key] = len;
(*crypt)->ops->set_key(sec.keys[key], len, NULL,
(*crypt)->priv);
- sec.flags |= (1 << key);
+ sec.flags |= BIT(key);
/* This ensures a key will be activated if no key is
* explicitely set */
if (key == sec.active_key)
@@ -400,7 +400,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
(*crypt)->ops->set_key(sec.keys[key], 13, NULL,
(*crypt)->priv);
sec.key_sizes[key] = 13;
- sec.flags |= (1 << key);
+ sec.flags |= BIT(key);
}
/* No key data - just set the default TX key index */
@@ -621,7 +621,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
if (ext->alg != IW_ENCODE_ALG_NONE) {
//memcpy(sec.keys[idx], ext->key, ext->key_len);
sec.key_sizes[idx] = ext->key_len;
- sec.flags |= (1 << idx);
+ sec.flags |= BIT(idx);
if (ext->alg == IW_ENCODE_ALG_WEP) {
// sec.encode_alg[idx] = SEC_ALG_WEP;
sec.flags |= SEC_LEVEL;