Skip to contentSkip to conversation

staging: rtl8712: Replace a bit shift by a use of BIT.

PATCH New Arushi Singhal 1 participant 1 message Mar 22, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8712: Replace a bit shift by a use of BIT.

This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle:
@@
constant c;
@@

-1 << c
+BIT(c)

---
 drivers/staging/rtl8712/rtl8712_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8712/rtl8712_xmit.c +1 -1
index 7fe626583c8a..a17531b30c1d 100644
@@ -503,7 +503,7 @@ static void update_txdesc(struct xmit_frame *pxmitframe, uint *pmem, int sz)
 			switch (pattrib->encrypt) {	/*SEC_TYPE*/
 			case _WEP40_:
 			case _WEP104_:
-				ptxdesc->txdw1 |= cpu_to_le32((0x01 << 22) &
+				ptxdesc->txdw1 |= cpu_to_le32((BIT(22)) &
 						  0x00c00000);
 				/*KEY_ID when WEP is used;*/
 				ptxdesc->txdw1 |= cpu_to_le32((psecuritypriv->
Signature · 1 line
2.11.0