]> git.proxmox.com Git - mirror_qemu.git/commitdiff
apm: remove #ifdef DEBUG.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Fri, 14 May 2010 07:29:23 +0000 (16:29 +0900)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 15 May 2010 16:41:51 +0000 (16:41 +0000)
remove #ifdef DEBUG by using macro.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/apm.c

index d20db3d16cddd4126101b88a1077a5e8f15e4f46..3cbde43a8b7c24d651bf610d4a1bd10e2b6ce5cd 100644 (file)
--- a/hw/apm.c
+++ b/hw/apm.c
 
 //#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;
 }