Skip to contentSkip to conversation

Staging: rtl8712: replace __constant_cpu_to_le16

PATCH In review Katie Dunne 2 participants 2 messages Feb 20, 2015 – Feb 23, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8712: replace __constant_cpu_to_le16

Addresses checkpatch.pl warning:
WARNING: __constant_cpu_to_le16 should be cpu_to_le16 by making the suggested replacement

---
 drivers/staging/rtl8712/wifi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/wifi.h +2 -2
index 73d7cd2..5ba7e71 100644
@@ -248,9 +248,9 @@ enum WIFI_REG_DOMAIN {
 
 #define SetFrameType(pbuf, type)	\
 	do {	\
-		*(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | \
+		*(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(3) | \
 		BIT(2))); \
-		*(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \
+		*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
 	} while (0)
 
 #define GetFrameSubType(pbuf)	(cpu_to_le16(*(unsigned short *)(pbuf)) & \
Signature · 1 line
1.9.1
#1 lore raw

drivers/staging/rtl8712/wifi.h enum WIFI_REG_DOMAIN { · line 254

Quoted 10 lines · On Friday 20 February 2015 15:44:01 Katie Dunne wrote:
 #define SetFrameType(pbuf, type)       \
        do {    \
drivers/staging/rtl8712/wifi.h +2 -2
-               *(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | \
+               *(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(3) | \
                BIT(2))); \
-               *(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \
+               *(unsigned short *)(pbuf) |= cpu_to_le16(type); \
        } while (0)

You could fix the indentation at the same time, and clean up both copies of the function if you see code like this.

However, a better fix would be to just remove the macro entirely, as it is not used anywhere.

Arnd