Skip to contentSkip to conversation

staging: Replace bit shifting with BIT macro

PATCH Superseded Payal Kshirsagar 2 participants 5 messages Apr 2, 2019 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover staging: Replace bit shifting with BIT macro

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.

Changes in v2:
-Remove type cast.

Payal Kshirsagar (2):
staging: rtl8723bs: core: Replace bit shifting with BIT macro
staging: rtlwifi: base.c: Replace bit shifting with BIT macro

 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 drivers/staging/rtlwifi/base.c                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/2 staging: rtl8723bs: core: Replace bit shifting with BIT macro

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.

---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +1 -1
index ebb45ac..254dd33 100644
@@ -3958,7 +3958,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch
 				/*  A-MSDU NOT Supported */
 				BA_para_set = 0;
 				/*  immediate Block Ack */
-				BA_para_set |= (1 << 1) & IEEE80211_ADDBA_PARAM_POLICY_MASK;
+				BA_para_set |= BIT(1) & IEEE80211_ADDBA_PARAM_POLICY_MASK;
 				/*  TID */
 				BA_para_set |= (status << 2) & IEEE80211_ADDBA_PARAM_TID_MASK;
 				/*  max buffer size is 8 MSDU */
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/2 staging: rtlwifi: base.c: Replace bit shifting with BIT macro

In reply to Payal Kshirsagar

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro and remove cast.

---
 drivers/staging/rtlwifi/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtlwifi/base.c +1 -1
index 35df2cf..e4e35de 100644
@@ -2446,7 +2446,7 @@ struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw,
 						  IEEE80211_STYPE_ACTION);
 	action_frame->u.action.category = WLAN_CATEGORY_BACK;
 	action_frame->u.action.u.delba.action_code = WLAN_ACTION_DELBA;
-	params = (u16)(1 << 11);	/* bit 11 initiator */
+	params = BIT(11);	/* bit 11 initiator */
 	params |= (u16)(tid << 12);	/* bit 15:12 TID number */
 
 	action_frame->u.action.u.delba.params = cpu_to_le16(params);
Signature · 1 line
2.7.4
#3 lore raw

Re: [Outreachy kernel] [PATCH v2 2/2] staging: rtlwifi: base.c: Replace bit shifting with BIT macro

Quoted 14 lines · Payal Kshirsagar

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro and remove cast.

---
 drivers/staging/rtlwifi/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtlwifi/base.c +0 -0
index 35df2cf..e4e35de 100644

drivers/staging/rtlwifi/base.c struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw, · line 2449

Quoted 5 lines
drivers/staging/rtlwifi/base.c +1 -1
@@ -2446,7 +2446,7 @@ struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw,
 						  IEEE80211_STYPE_ACTION);
 	action_frame->u.action.category = WLAN_CATEGORY_BACK;
 	action_frame->u.action.u.delba.action_code = WLAN_ACTION_DELBA;
-	params = (u16)(1 << 11);	/* bit 11 initiator */
+	params = BIT(11);	/* bit 11 initiator */

It seems that the comments were nicely lined up before, so it would begood to do that again.

julia

Quoted 13 lines
drivers/staging/rtlwifi/base.c +0 -1
 	params |= (u16)(tid << 12);	/* bit 15:12 TID number */
 
 	action_frame->u.action.u.delba.params = cpu_to_le16(params);
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/bc0ddc96e3352f76c36af42f2bce0230ba528180.1554212525.git.payal.s.kshirsagar.98%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw

Re: [Outreachy kernel] [PATCH v2 2/2] staging: rtlwifi: base.c: Replace bit shifting with BIT macro

Quoted 20 lines · Julia Lawall

Review

Quoted 10 lines · Payal Kshirsagar

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro and remove cast.

---
 drivers/staging/rtlwifi/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/staging/rtlwifi/base.c

drivers/staging/rtlwifi/base.c struct sk_buff *rtl_make_del_ba(struct

Quoted 4 lines

index 35df2cf..e4e35de 100644

drivers/staging/rtlwifi/base.c +0 -0
@@ -2446,7 +2446,7 @@ struct sk_buff *rtl_make_del_ba(struct

ieee80211_hw *hw,

Quoted 9 lines

drivers/staging/rtlwifi/base.c struct sk_buff *rtl_make_del_ba(struct ieee80211_hw *hw, · line 2449

Quoted 5 lines
drivers/staging/rtlwifi/base.c +1 -1
                                                IEEE80211_STYPE_ACTION);
      action_frame->u.action.category = WLAN_CATEGORY_BACK;
      action_frame->u.action.u.delba.action_code = WLAN_ACTION_DELBA;
-     params = (u16)(1 << 11);        /* bit 11 initiator */
+     params = BIT(11);       /* bit 11 initiator */

It seems that the comments were nicely lined up before, so it would begood to do that again.

Okay doing and sending v3.
thanks,
payal

julia

Quoted 30 lines
Quoted 9 lines
drivers/staging/rtlwifi/base.c +0 -1
      params |= (u16)(tid << 12);     /* bit 15:12 TID number */
 
      action_frame->u.action.u.delba.params = cpu_to_le16(params);
--

2.7.4

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/bc0ddc96e3352f76c36af42f2bce0230ba528180.1554212525.git.payal.s.kshirsagar.98%40gmail.com
.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.20.1904021601500.3297%40hadrien
.
For more options, visit https://groups.google.com/d/optout.