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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

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@xxxxxxxxxxxx>
---
 src/mcm_rereg_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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
-- 
2.21.0




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux