qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 06/14] s390x: Convert conditional compilation of deb


From: Marc Marí
Subject: [Qemu-devel] [PATCH 06/14] s390x: Convert conditional compilation of debug printfs to regular ifs
Date: Mon, 28 Apr 2014 10:26:07 +0200

From: Marc Marí <address@hidden>

Modify debug macros as explained in 
https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg03642.html

Signed-off-by: Marc Marí <address@hidden>
---
 hw/s390x/s390-virtio-bus.c |   17 ++++++++++-------
 hw/s390x/s390-virtio.c     |   17 ++++++++++-------
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 9c71afa..ae23b9b 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -35,16 +35,19 @@
 #include "hw/s390x/s390-virtio-bus.h"
 #include "hw/virtio/virtio-bus.h"
 
-/* #define DEBUG_S390 */
+/* #define DEBUG_S390 1*/
 
-#ifdef DEBUG_S390
-#define DPRINTF(fmt, ...) \
-    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-    do { } while (0)
+#ifndef DEBUG_S390
+#define DEBUG_S390 0
 #endif
 
+#define DPRINTF(fmt, ...) \
+    do { \
+        if(DEBUG_S390) { \
+            fprintf(stderr, fmt, ## __VA_ARGS__); \
+        } \
+    } while (0)
+
 #define VIRTIO_EXT_CODE   0x2603
 
 static void virtio_s390_bus_new(VirtioBusState *bus, size_t bus_size,
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index aef2003..1c81b90 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -39,16 +39,19 @@
 #include "hw/s390x/s390_flic.h"
 #include "hw/s390x/s390-virtio.h"
 
-//#define DEBUG_S390
+//#define DEBUG_S390 1
 
-#ifdef DEBUG_S390
-#define DPRINTF(fmt, ...) \
-    do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...) \
-    do { } while (0)
+#ifndef DEBUG_S390
+#define DEBUG_S390 0
 #endif
 
+#define DPRINTF(fmt, ...) \
+    do { \
+        if(DEBUG_S390) { \
+            fprintf(stderr, fmt, ## __VA_ARGS__); \
+        } \
+    } while (0)
+
 #define MAX_BLK_DEVS                    10
 #define ZIPL_FILENAME                   "s390-zipl.rom"
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]