driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: cleanup macros within include/rtw_debug.h
@ 2021-02-10 17:00 Phillip Potter
  2021-02-10 17:12 ` Greg KH
  2021-02-10 18:40 ` Dan Carpenter
  0 siblings, 2 replies; 9+ messages in thread
From: Phillip Potter @ 2021-02-10 17:00 UTC (permalink / raw)
  To: gregkh; +Cc: devel, luk, linux-kernel

Remove do/while loops from DBG_871X, MSG_8192C and DBG_8192C. Also
fix opening brace placements and trailing single statement layout within
RT_PRINT_DATA, as well as making newline character placement more
consistent and removing camel case where possible. Finally, add
parentheses for DBG_COUNTER definition.

This fixes 3 checkpatch warnings, 5 checkpatch errors and 3 checkpatch
checks.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
---
 drivers/staging/rtl8723bs/include/rtw_debug.h | 40 +++++++++----------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h
index c90adfb87261..d06ac9540cf7 100644
--- a/drivers/staging/rtl8723bs/include/rtw_debug.h
+++ b/drivers/staging/rtl8723bs/include/rtw_debug.h
@@ -201,19 +201,16 @@
 #ifdef DEBUG
 #if	defined(_dbgdump)
 	#undef DBG_871X
-	#define DBG_871X(...)     do {\
-		_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
-	} while (0)
+	#define DBG_871X(...)\
+		_dbgdump(DRIVER_PREFIX __VA_ARGS__)
 
 	#undef MSG_8192C
-	#define MSG_8192C(...)     do {\
-		_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
-	} while (0)
+	#define MSG_8192C(...)\
+		_dbgdump(DRIVER_PREFIX __VA_ARGS__)
 
 	#undef DBG_8192C
-	#define DBG_8192C(...)     do {\
-		_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
-	} while (0)
+	#define DBG_8192C(...)\
+		_dbgdump(DRIVER_PREFIX __VA_ARGS__)
 #endif /* defined(_dbgdump) */
 #endif /* DEBUG */
 
@@ -235,25 +232,26 @@
 
 #if	defined(_dbgdump)
 	#undef RT_PRINT_DATA
-	#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen)			\
-		if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel))	\
-		{									\
+	#define RT_PRINT_DATA(_comp, _level, _title_string, _hex_data, _hex_data_len)		\
+	do {											\
+		if (((_comp) & GlobalDebugComponents) && ((_level) <= GlobalDebugLevel)) {	\
 			int __i;								\
-			u8 *ptr = (u8 *)_HexData;				\
+			u8 *ptr = (u8 *)_hex_data;						\
 			_dbgdump("%s", DRIVER_PREFIX);						\
-			_dbgdump(_TitleString);						\
-			for (__i = 0; __i < (int)_HexDataLen; __i++)				\
-			{								\
+			_dbgdump(_title_string);						\
+			for (__i = 0; __i < (int)_hex_data_len; __i++) {			\
 				_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?"  ":" ");	\
-				if (((__i + 1) % 16) == 0)	_dbgdump("\n");			\
-			}								\
-			_dbgdump("\n");							\
-		}
+				if (((__i + 1) % 16) == 0)					\
+					_dbgdump("\n");						\
+			}									\
+			_dbgdump("\n");								\
+		}										\
+	} while (0)
 #endif /* defined(_dbgdump) */
 #endif /* DEBUG_RTL871X */
 
 #ifdef CONFIG_DBG_COUNTER
-#define DBG_COUNTER(counter) counter++
+#define DBG_COUNTER(counter) ((counter)++)
 #else
 #define DBG_COUNTER(counter) do {} while (0)
 #endif
-- 
2.29.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-10 21:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 17:00 [PATCH] staging: rtl8723bs: cleanup macros within include/rtw_debug.h Phillip Potter
2021-02-10 17:12 ` Greg KH
2021-02-10 17:34   ` Phillip Potter
2021-02-10 17:48     ` Greg KH
2021-02-10 18:40 ` Dan Carpenter
2021-02-10 18:55   ` Phillip Potter
2021-02-10 19:36     ` Greg KH
2021-02-10 20:18     ` Dan Carpenter
2021-02-10 21:00       ` Phillip Potter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).