summaryrefslogtreecommitdiff
path: root/drivers/net/fddi/skfp/h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2016-12-21 16:41:52 -0800
committerDavid S. Miller <davem@davemloft.net>2016-12-29 11:37:14 -0500
commit5dbc6530939126cd61cb6c2e6d7b0a95741aaee6 (patch)
tree2518ee543493901d99a7eba55e51a9404406f663 /drivers/net/fddi/skfp/h
parentb77b7565a6d11611c3f179941d2b95c2d72939dc (diff)
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: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fddi/skfp/h')
-rw-r--r--drivers/net/fddi/skfp/h/hwmtm.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/net/fddi/skfp/h/hwmtm.h b/drivers/net/fddi/skfp/h/hwmtm.h
index 4ca2341d7f06..123cfa09c354 100644
--- a/drivers/net/fddi/skfp/h/hwmtm.h
+++ b/drivers/net/fddi/skfp/h/hwmtm.h
@@ -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