Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5dbc6530 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

skfp: hwmtm: Use proper logging macros, correct mismatches



Logging macros should allow format and argument validation.
The DB_TX, DB_RX, and DB_GEN macros did not.

Update the macros and uses and add no_printk validation to the
previously compiled away #ifndef DEBUG variants.

Done with coccinelle and some typing.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b77b7565
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -168,13 +168,25 @@ struct os_debug {
#define DB_P	debug
#endif

#define DB_RX(a,b,c,lev) if (DB_P.d_os.hwm_rx >= (lev))	printf(a,b,c)
#define DB_TX(a,b,c,lev) if (DB_P.d_os.hwm_tx >= (lev))	printf(a,b,c)
#define DB_GEN(a,b,c,lev) if (DB_P.d_os.hwm_gen >= (lev)) printf(a,b,c)
#define DB_RX(lev, fmt, ...)						\
do {									\
	if (DB_P.d_os.hwm_rx >= (lev))					\
		printf(fmt "\n", ##__VA_ARGS__);			\
} while (0)
#define DB_TX(lev, fmt, ...)						\
do {									\
	if (DB_P.d_os.hwm_tx >= (lev))					\
		printf(fmt "\n", ##__VA_ARGS__);			\
} while (0)
#define DB_GEN(lev, fmt, ...)						\
do {									\
	if (DB_P.d_os.hwm_gen >= (lev))					\
		printf(fmt "\n", ##__VA_ARGS__);			\
} while (0)
#else	/* DEBUG */
#define DB_RX(a,b,c,lev)
#define DB_TX(a,b,c,lev)
#define DB_GEN(a,b,c,lev)
#define DB_RX(lev, fmt, ...)	no_printk(fmt "\n", ##__VA_ARGS__)
#define DB_TX(lev, fmt, ...)	no_printk(fmt "\n", ##__VA_ARGS__)
#define DB_GEN(lev, fmt, ...)	no_printk(fmt "\n", ##__VA_ARGS__)
#endif	/* DEBUG */

#ifndef	SK_BREAK
+88 −88

File changed.

Preview size limit exceeded, changes collapsed.