[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 13/16] isa: Convert conditional compilation of de
From: |
Marc Marí |
Subject: |
[Qemu-devel] [PATCH v2 13/16] isa: Convert conditional compilation of debug printfs to regular ifs |
Date: |
Tue, 13 May 2014 09:02:49 +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/isa/vt82c686.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 1a93afd..5184e4b 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -29,11 +29,13 @@
//#define DEBUG_VT82C686B
#ifdef DEBUG_VT82C686B
-#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__,
##__VA_ARGS__)
+#define DEBUG_VT82C686B_ENABLED 1
#else
-#define DPRINTF(fmt, ...)
+#define DEBUG_VT82C686B_ENABLED 0
#endif
+#define DPRINTF(fmt, ...) QEMU_DPRINTF(DEBUG_VT82C686B_ENABLED, "vt82c686",
fmt, ## __VA_ARGS__)
+
typedef struct SuperIOConfig
{
uint8_t config[0xff];
@@ -53,7 +55,7 @@ static void superio_ioport_writeb(void *opaque, hwaddr addr,
uint64_t data,
int can_write;
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data);
+ DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", (unsigned)addr,
(unsigned)data);
if (addr == 0x3f0) {
superio_conf->index = data & 0xff;
} else {
@@ -99,7 +101,7 @@ static uint64_t superio_ioport_readb(void *opaque, hwaddr
addr, unsigned size)
{
SuperIOConfig *superio_conf = opaque;
- DPRINTF("superio_ioport_readb address 0x%x\n", addr);
+ DPRINTF("superio_ioport_readb address 0x%x\n", (unsigned)addr);
return (superio_conf->config[superio_conf->index]);
}
--
1.7.10.4
- [Qemu-devel] [PATCH v2 06/16] spapr: Convert conditional compilation of debug printfs to regular ifs, (continued)
- [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
- [Qemu-devel] [PATCH v2 11/16] rc4030: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 10/16] i8257: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 12/16] sd: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 13/16] isa: Convert conditional compilation of debug printfs to regular ifs,
Marc Marí <=
- [Qemu-devel] [PATCH v2 14/16] lan9118: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 15/16] pci-host: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13
- [Qemu-devel] [PATCH v2 16/16] common: Convert conditional compilation of debug printfs to regular ifs, Marc Marí, 2014/05/13