diff mbox series

[ibdiags,08/14] ibdiags: Use a static inline for the empty debug

Message ID 20190308195515.3408-9-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show
Series Fix warnings in infiniband-diags | expand

Commit Message

Jason Gunthorpe March 8, 2019, 7:55 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

So that format checking still works when not compiling for debug.

Fixes the compiler warning:
 warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 src/mcm_rereg_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/mcm_rereg_test.c b/src/mcm_rereg_test.c
index 183ebd5bcccd0d..95aded688aabde 100644
--- a/src/mcm_rereg_test.c
+++ b/src/mcm_rereg_test.c
@@ -51,7 +51,10 @@ 
 #ifdef NOISY_DEBUG
 #define dbg(fmt, ...) fprintf(stderr, "DBG: " fmt, ## __VA_ARGS__ )
 #else
-#define dbg(fmt, ...)
+__attribute__((format(printf, 1, 2))) static inline void dbg(const char *fmt,
+							     ...)
+{
+}
 #endif
 
 #define TMO 100