[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V11 26/27] pc_apm: remove #ifdef DEBUG.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH V11 26/27] pc_apm: remove #ifdef DEBUG. |
Date: |
Tue, 5 Jan 2010 15:27:49 +0900 |
remove #ifdef DEBUG by using macro.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pc_apm.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/pc_apm.c b/hw/pc_apm.c
index f6bcd7d..e1cee96 100644
--- a/hw/pc_apm.c
+++ b/hw/pc_apm.c
@@ -23,6 +23,12 @@
//#define DEBUG
+#ifdef DEBUG
+# define APM_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
+#else
+# define APM_DPRINTF(format, ...) do { } while (0)
+#endif
+
/* fixed I/O location */
#define APM_CNT_IOPORT 0xb2
#define APM_STS_IOPORT 0xb3
@@ -31,9 +37,7 @@ static void apm_ioport_writeb(void *opaque, uint32_t addr,
uint32_t val)
{
APMState *apm = opaque;
addr &= 1;
-#ifdef DEBUG
- printf("apm_ioport_writeb addr=0x%x val=0x%02x\n", addr, val);
-#endif
+ APM_DPRINTF("apm_ioport_writeb addr=0x%x val=0x%02x\n", addr, val);
if (addr == 0) {
apm->apmc = val;
@@ -56,9 +60,7 @@ static uint32_t apm_ioport_readb(void *opaque, uint32_t addr)
} else {
val = apm->apms;
}
-#ifdef DEBUG
- printf("apm_ioport_readb addr=0x%x val=0x%02x\n", addr, val);
-#endif
+ APM_DPRINTF("apm_ioport_readb addr=0x%x val=0x%02x\n", addr, val);
return val;
}
--
1.6.5.4
- [Qemu-devel] [PATCH V11 02/27] acpi: split out apm register emulation from acpi.c, (continued)
- [Qemu-devel] [PATCH V11 22/27] pci hotplug: add argument to pci hot plug callback., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V11 27/27] mc146818rtc: remove #ifdef DEBUG_CMOS., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V11 09/27] pc: remove a global variable, floppy_controller., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V11 11/27] pc: introduce a function to allocate cpu irq., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V11 26/27] pc_apm: remove #ifdef DEBUG.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH V11 19/27] pc: move rtc declarations from pc.h into a dedicated header file., Isaku Yamahata, 2010/01/05
- [Qemu-devel] [PATCH V11 25/27] acpi_piix4: remove #ifdef DEBUG., Isaku Yamahata, 2010/01/05