All of lore.kernel.org
 help / color / mirror / Atom feed
* [Outreachy kernel] [PATCH 0/3]  staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro
@ 2019-04-02 13:28 Payal Kshirsagar
  2019-04-02 13:28 ` [Outreachy kernel] [PATCH 1/3] staging: rtl8192u: ieee80211: ieee80211_rx.c: " Payal Kshirsagar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Payal Kshirsagar @ 2019-04-02 13:28 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Payal Kshirsagar

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(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Outreachy kernel] [PATCH 1/3] staging: rtl8192u: ieee80211: ieee80211_rx.c: Replace bit shifting with BIT macro
  2019-04-02 13:28 [Outreachy kernel] [PATCH 0/3] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro Payal Kshirsagar
@ 2019-04-02 13:28 ` Payal Kshirsagar
  2019-04-02 13:28 ` [Outreachy kernel] [PATCH 2/3] staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: " Payal Kshirsagar
  2019-04-02 13:28 ` [Outreachy kernel] [PATCH 3/3] staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: " Payal Kshirsagar
  2 siblings, 0 replies; 4+ messages in thread
From: Payal Kshirsagar @ 2019-04-02 13:28 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Payal Kshirsagar

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>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 32 +++++++++++------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index 5147f7c..4aca149 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -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",
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Outreachy kernel] [PATCH 2/3] staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: Replace bit shifting with BIT macro
  2019-04-02 13:28 [Outreachy kernel] [PATCH 0/3] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro Payal Kshirsagar
  2019-04-02 13:28 ` [Outreachy kernel] [PATCH 1/3] staging: rtl8192u: ieee80211: ieee80211_rx.c: " Payal Kshirsagar
@ 2019-04-02 13:28 ` Payal Kshirsagar
  2019-04-02 13:28 ` [Outreachy kernel] [PATCH 3/3] staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: " Payal Kshirsagar
  2 siblings, 0 replies; 4+ messages in thread
From: Payal Kshirsagar @ 2019-04-02 13:28 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Payal Kshirsagar

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>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index 3534ddb..e154df8 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -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);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Outreachy kernel] [PATCH 3/3] staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: Replace bit shifting with BIT macro
  2019-04-02 13:28 [Outreachy kernel] [PATCH 0/3] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro Payal Kshirsagar
  2019-04-02 13:28 ` [Outreachy kernel] [PATCH 1/3] staging: rtl8192u: ieee80211: ieee80211_rx.c: " Payal Kshirsagar
  2019-04-02 13:28 ` [Outreachy kernel] [PATCH 2/3] staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: " Payal Kshirsagar
@ 2019-04-02 13:28 ` Payal Kshirsagar
  2 siblings, 0 replies; 4+ messages in thread
From: Payal Kshirsagar @ 2019-04-02 13:28 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Payal Kshirsagar

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>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 4 ++--
 1 file 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 829fa4b..320c179 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);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-02 13:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02 13:28 [Outreachy kernel] [PATCH 0/3] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro Payal Kshirsagar
2019-04-02 13:28 ` [Outreachy kernel] [PATCH 1/3] staging: rtl8192u: ieee80211: ieee80211_rx.c: " Payal Kshirsagar
2019-04-02 13:28 ` [Outreachy kernel] [PATCH 2/3] staging: rtl8192u: ieee80211: ieee80211_crypt_ccmp.c: " Payal Kshirsagar
2019-04-02 13:28 ` [Outreachy kernel] [PATCH 3/3] staging: rtl8192u: ieee80211: ieee80211_crypt_tkip.c: " Payal Kshirsagar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.