Skip to contentSkip to conversation

staging: rtl8723bs: do not use __constant_cpu_to_le16

PATCH In review Sergey Senozhatsky 2 participants 3 messages Mar 17, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8723bs: do not use __constant_cpu_to_le16

From: Sergey Senozhatsky <[email protected]>

cpu_to_le16() is capable enough to detect __builtin_constant_p() and to use an appropriate compile time ___constant_swahbXX() function.

So we can use cpu_to_le16() instead of __constant_cpu_to_le16().

---
 drivers/staging/rtl8723bs/include/wifi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/include/wifi.h +2 -2
index 559bf2606fb7..1e79e6f0c206 100644
@@ -266,8 +266,8 @@ enum WIFI_REG_DOMAIN {
 
 #define SetFrameType(pbuf, type)	\
 	do {	\
-		*(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \
-		*(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \
+		*(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(3) | BIT(2))); \
+		*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
 	} while (0)
 
 #define GetFrameSubType(pbuf)	(le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) |\
Signature · 1 line
2.21.0
#1 lore raw
Quoted 1 line · Sergey Senozhatsky

From: Sergey Senozhatsky <[email protected]>

Why ".work"?

Quoted 8 lines

cpu_to_le16() is capable enough to detect __builtin_constant_p() and to use an appropriate compile time ___constant_swahbXX() function.

So we can use cpu_to_le16() instead of __constant_cpu_to_le16().

Email address does not match up to the From: line above :(

#2 lore raw
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line · Sergey Senozhatsky

From: Sergey Senozhatsky <[email protected]>

Why ".work"?

Aha, good question. There is not so much of a difference between .work and !.work. (if any at all).

Quoted 9 lines
Quoted 7 lines

cpu_to_le16() is capable enough to detect __builtin_constant_p() and to use an appropriate compile time ___constant_swahbXX() function.

So we can use cpu_to_le16() instead of __constant_cpu_to_le16().

Email address does not match up to the From: line above :(

Greg, sorry about that!
Either you were the first one to complaint or this was the first time I re-rent a patch from a different google account.

	-ss