Skip to contentSkip to conversation

Staging: rtl8712 : wifi.h: Fixed Macro argument reuse

PATCH New Jaya Durga 1 participant 1 message Jun 23, 2017 Staging

lore
Share & tools
lore

Jaya Durga

author
#0 lore raw

PATCH 3/3 Staging: rtl8712 : wifi.h: Fixed Macro argument reuse

CHECK: Macro argument reuse 'pframe' - possible side-effects?

Convert get_tofr_ds macro to inline functions to fix checkpatch check

---
 drivers/staging/rtl8712/wifi.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/wifi.h +4 -2
index 556367b..0ed2f44 100644
@@ -170,8 +170,10 @@ enum WIFI_REG_DOMAIN {
 	*(__le16 *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
 })
 
-#define get_tofr_ds(pframe)	((GetToDs(pframe) << 1) | GetFrDs(pframe))
-
+static inline unsigned char get_tofr_ds(unsigned char *pframe)
+{
+	return ((GetToDs(pframe) << 1) | GetFrDs(pframe));
+}
 
 #define SetMFrag(pbuf) ({ \
 	*(__le16 *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
Signature · 1 line
1.9.1