misc: zynq_slcr: Make DB_PRINTs always compile
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Tue, 15 Apr 2014 18:49:11 +0000 (19:49 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 17 Apr 2014 20:34:07 +0000 (21:34 +0100)
Change the DB_PRINT macro over to a regular if() rather than
conditional compilation to give constant compile testing of formats.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 942477847353c5cff5f45a228cc88c633dc012f3.1396503037.git.peter.crosthwaite@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/misc/zynq_slcr.c

index 06eba08f7f156c3115fc843994e5b1b8250f64bc..2e53a2e21f3a96d1bb5ce7095890fa9448c52482 100644 (file)
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
 
-#ifdef ZYNQ_ARM_SLCR_ERR_DEBUG
+#ifndef ZYNQ_SLCR_ERR_DEBUG
+#define ZYNQ_SLCR_ERR_DEBUG 0
+#endif
+
 #define DB_PRINT(...) do { \
-    fprintf(stderr,  ": %s: ", __func__); \
-    fprintf(stderr, ## __VA_ARGS__); \
+        if (ZYNQ_SLCR_ERR_DEBUG) { \
+            fprintf(stderr,  ": %s: ", __func__); \
+            fprintf(stderr, ## __VA_ARGS__); \
+        } \
     } while (0);
-#else
-    #define DB_PRINT(...)
-#endif
 
 #define XILINX_LOCK_KEY 0x767b
 #define XILINX_UNLOCK_KEY 0xdf0d