[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 04/16] highbank: Convert conditional compilation
From: |
Marc Marí |
Subject: |
[Qemu-devel] [PATCH v2 04/16] highbank: Convert conditional compilation of debug printfs to regular ifs |
Date: |
Tue, 13 May 2014 09:02:40 +0200 |
Modify debug macros to have the same format through the codebase and use regular
ifs instead of ifdef.
As the debug printf is always put in code, some casting had to be added to avoid
warnings treated as errors at compile time.
Signed-off-by: Marc Marí <address@hidden>
---
hw/net/xgmac.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/net/xgmac.c b/hw/net/xgmac.c
index 88349ac..734c2e5 100644
--- a/hw/net/xgmac.c
+++ b/hw/net/xgmac.c
@@ -30,14 +30,16 @@
#include "net/net.h"
#include "net/checksum.h"
+//#define DEBUG_XGMAC
+
#ifdef DEBUG_XGMAC
-#define DEBUGF_BRK(message, args...) do { \
- fprintf(stderr, (message), ## args); \
- } while (0)
+#define DEBUG_XGMAC_ENABLED 1
#else
-#define DEBUGF_BRK(message, args...) do { } while (0)
+#define DEBUG_XGMAC_ENABLED 0
#endif
+#define DEBUGF_BRK(message, args...) QEMU_DPRINTF(DEBUG_XGMAC_ENABLED,
"xgmag", message, ## args)
+
#define XGMAC_CONTROL 0x00000000 /* MAC Configuration */
#define XGMAC_FRAME_FILTER 0x00000001 /* MAC Frame Filter */
#define XGMAC_FLOW_CTRL 0x00000006 /* MAC Flow Control */
--
1.7.10.4
- [Qemu-devel] [PATCH v2 00/16] Convert conditional compilation of debug printfs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 01/16] x86: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 02/16] s390: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 03/16] scsi: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 04/16] highbank: Convert conditional compilation of debug printfs to regular ifs,
Marc Marí <=
- [Qemu-devel] [PATCH v2 05/16] xilinx: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 07/16] stellaris: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 06/16] spapr: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 08/16] tpm: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 09/16] i82374: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13