Commit fc7083b53008bbe5c13baab0ce869d2549bc1754

Authored by Isaku Yamahata
Committed by Anthony Liguori
1 parent 1e37d059

ioport: remove some #ifdef DEBUG_UNUSED_IOPORT.

remove some #ifdef DEBUG_UNUSED_IOPORT in ioport.c
and use PRIx32 where appropriate

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 1 changed file with 12 additions and 12 deletions
ioport.c
@@ -33,6 +33,12 @@ @@ -33,6 +33,12 @@
33 //#define DEBUG_UNUSED_IOPORT 33 //#define DEBUG_UNUSED_IOPORT
34 //#define DEBUG_IOPORT 34 //#define DEBUG_IOPORT
35 35
  36 +#ifdef DEBUG_UNUSED_IOPORT
  37 +# define LOG_UNUSED_IOPORT(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
  38 +#else
  39 +# define LOG_UNUSED_IOPORT(fmt, ...) do{ } while (0)
  40 +#endif
  41 +
36 #ifdef DEBUG_IOPORT 42 #ifdef DEBUG_IOPORT
37 # define LOG_IOPORT(...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__) 43 # define LOG_IOPORT(...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__)
38 #else 44 #else
@@ -76,17 +82,14 @@ static void ioport_write(int index, uint32_t address, uint32_t data) @@ -76,17 +82,14 @@ static void ioport_write(int index, uint32_t address, uint32_t data)
76 82
77 static uint32_t default_ioport_readb(void *opaque, uint32_t address) 83 static uint32_t default_ioport_readb(void *opaque, uint32_t address)
78 { 84 {
79 -#ifdef DEBUG_UNUSED_IOPORT  
80 - fprintf(stderr, "unused inb: port=0x%04x\n", address);  
81 -#endif 85 + LOG_UNUSED_IOPORT("unused inb: port=0x%04"PRIx32"\n", address);
82 return 0xff; 86 return 0xff;
83 } 87 }
84 88
85 static void default_ioport_writeb(void *opaque, uint32_t address, uint32_t data) 89 static void default_ioport_writeb(void *opaque, uint32_t address, uint32_t data)
86 { 90 {
87 -#ifdef DEBUG_UNUSED_IOPORT  
88 - fprintf(stderr, "unused outb: port=0x%04x data=0x%02x\n", address, data);  
89 -#endif 91 + LOG_UNUSED_IOPORT("unused outb: port=0x%04"PRIx32" data=0x%02"PRIx32"\n",
  92 + address, data);
90 } 93 }
91 94
92 /* default is to make two byte accesses */ 95 /* default is to make two byte accesses */
@@ -108,17 +111,14 @@ static void default_ioport_writew(void *opaque, uint32_t address, uint32_t data) @@ -108,17 +111,14 @@ static void default_ioport_writew(void *opaque, uint32_t address, uint32_t data)
108 111
109 static uint32_t default_ioport_readl(void *opaque, uint32_t address) 112 static uint32_t default_ioport_readl(void *opaque, uint32_t address)
110 { 113 {
111 -#ifdef DEBUG_UNUSED_IOPORT  
112 - fprintf(stderr, "unused inl: port=0x%04x\n", address);  
113 -#endif 114 + LOG_UNUSED_IOPORT("unused inl: port=0x%04"PRIx32"\n", address);
114 return 0xffffffff; 115 return 0xffffffff;
115 } 116 }
116 117
117 static void default_ioport_writel(void *opaque, uint32_t address, uint32_t data) 118 static void default_ioport_writel(void *opaque, uint32_t address, uint32_t data)
118 { 119 {
119 -#ifdef DEBUG_UNUSED_IOPORT  
120 - fprintf(stderr, "unused outl: port=0x%04x data=0x%02x\n", address, data);  
121 -#endif 120 + LOG_UNUSED_IOPORT("unused outl: port=0x%04"PRIx32" data=0x%02"PRIx32"\n",
  121 + address, data);
122 } 122 }
123 123
124 static int ioport_bsize(int size, int *bsize) 124 static int ioport_bsize(int size, int *bsize)