Skip to contentSkip to conversation

staging: Replace bit shifting with BIT macro

PATCH In review Payal Kshirsagar 2 participants 5 messages Apr 2, 2019 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: Replace bit shifting with BIT macro

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

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 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 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.

---
 drivers/staging/rtlwifi/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtlwifi/base.c +1 -1
index 35df2cf..e9830b1 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 = (u16)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 2/2] staging: rtlwifi: base.c: Replace bit shifting with BIT macro

Quoted 13 lines · Payal Kshirsagar

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

---
 drivers/staging/rtlwifi/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtlwifi/base.c +0 -0
index 35df2cf..e9830b1 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 = (u16)BIT(11);	/* bit 11 initiator */

Why are you still casting here?

thanks,

greg k-h

#4 lore raw

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

Quoted 16 lines · Greg KH

Review

Quoted 9 lines · Payal Kshirsagar

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

---
 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..e9830b1 100644

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

ieee80211_hw *hw,

Quoted 8 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 = (u16)BIT(11);  /* bit 11 initiator */

Why are you still casting here?

Yes, there is a no need to cast.
I will correct it and send v2 for this patchset.
thanks,
payal

Quoted 4 lines

thanks,

greg k-h