Skip to contentSkip to conversation

staging: Replace bit shifting with BIT macro

PATCH New Payal Kshirsagar 1 participant 3 messages Apr 2, 2019 Staging

lore
Share & tools
lore
#0 lore raw

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

Changes in v3:
-Align comments properly.

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