[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V10 27/27] mc146818rtc: remove #ifdef DEBUG_CMOS.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH V10 27/27] mc146818rtc: remove #ifdef DEBUG_CMOS. |
Date: |
Thu, 24 Dec 2009 17:09:20 +0900 |
remove #ifdef DEBUG_CMOS by using macro.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/mc146818rtc.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 1eb991c..0e1dc07 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -31,6 +31,12 @@
//#define DEBUG_CMOS
+#ifdef DEBUG_CMOS
+# define CMOS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
+#else
+# define CMOS_DPRINTF(format, ...) do { } while (0)
+#endif
+
#define RTC_REINJECT_ON_ACK_COUNT 1000
#define RTC_SECONDS 0
@@ -210,10 +216,8 @@ static void cmos_ioport_write(void *opaque, uint32_t addr,
uint32_t data)
if ((addr & 1) == 0) {
s->cmos_index = data & 0x7f;
} else {
-#ifdef DEBUG_CMOS
- printf("cmos: write index=0x%02x val=0x%02x\n",
- s->cmos_index, data);
-#endif
+ CMOS_DPRINTF("cmos: write index=0x%02x val=0x%02x\n",
+ s->cmos_index, data);
switch(s->cmos_index) {
case RTC_SECONDS_ALARM:
case RTC_MINUTES_ALARM:
@@ -482,10 +486,8 @@ static uint32_t cmos_ioport_read(void *opaque, uint32_t
addr)
ret = s->cmos_data[s->cmos_index];
break;
}
-#ifdef DEBUG_CMOS
- printf("cmos: read index=0x%02x val=0x%02x\n",
- s->cmos_index, ret);
-#endif
+ CMOS_DPRINTF("cmos: read index=0x%02x val=0x%02x\n",
+ s->cmos_index, ret);
return ret;
}
}
--
1.6.5.4
- [Qemu-devel] [PATCH V10 00/27] split out piix specific part from pc emulator and some clean ups, Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 12/27] pc: make pc_init1() not refer ferr_irq directly., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 17/27] pc: split out pci device init from pc_init1() into pc_pci_device_init(), Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 19/27] pc: move rtc declarations from pc.h into a dedicated header file., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 27/27] mc146818rtc: remove #ifdef DEBUG_CMOS.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH V10 21/27] acpi_piix4: qdevfy., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 04/27] acpi: split acpi.c into the common part and the piix4 part., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 22/27] pci hotplug: add argument to pci hot plug callback., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 09/27] pc: remove a global variable, floppy_controller., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 20/27] rtc: make rtc_xxx accept/return ISADevice instead of RTCState., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 15/27] pc: split out vga initialization from pc_init1() into pc_vga_init()., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 11/27] pc: introduce a function to allocate cpu irq., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 23/27] pci hotadd, acpi_piix4: remove global variables., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 01/27] acpi: split out pc smbus routines from acpi.c into pc_smbus.c, Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 08/27] pc: make an unnecessary global variable, pit, local., Isaku Yamahata, 2009/12/24