Skip to contentSkip to conversation

staging: rtl8712: Place constants on the right side

PATCH Superseded Bhaktipriya Shridhar 2 participants 2 messages Feb 19, 2016 – Feb 20, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 staging: rtl8712: Place constants on the right side

Move constants to the right of binary operators. This issue was identified using the Coccinelle script misc/compare_const_fl.cocci

---
 drivers/staging/rtl8712/wifi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/wifi.h +2 -2
index 7a352c4..ee41971 100644
@@ -260,12 +260,12 @@ enum WIFI_REG_DOMAIN {
 	*(unsigned short *)((addr_t)(pbuf) + 22) = \
 	((*(unsigned short *)((addr_t)(pbuf) + 22)) & \
 	le16_to_cpu((unsigned short)0x000f)) | \
-	le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \
+	le16_to_cpu((unsigned short)((num << 4) & 0xfff0)); \
 })
 
 #define SetDuration(pbuf, dur) ({ \
 	*(unsigned short *)((addr_t)(pbuf) + 2) |= \
-	cpu_to_le16(0xffff & (dur)); \
+	cpu_to_le16((dur) & 0xffff); \
 })
 
 #define SetPriority(pbuf, tid) ({ \

--
2.1.4

maintainer
#1 lore raw
Quoted 8 lines · Bhaktipriya Shridhar

Move constants to the right of binary operators. This issue was identified using the Coccinelle script misc/compare_const_fl.cocci

---
 drivers/staging/rtl8712/wifi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

All 4 of these patches have the same subject: so I can't take them :(

Please fix up and resend.

thanks,

greg k-h