[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V10 24/27] pc_smbus: remove #ifdef DEBUG.
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH V10 24/27] pc_smbus: remove #ifdef DEBUG. |
Date: |
Thu, 24 Dec 2009 17:09:17 +0900 |
remove #ifdef DEBUG by using macro.
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pc_smbus.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/hw/pc_smbus.c b/hw/pc_smbus.c
index 850260d..9581aba 100644
--- a/hw/pc_smbus.c
+++ b/hw/pc_smbus.c
@@ -37,6 +37,15 @@
#define SMBHSTDAT1 0x06
#define SMBBLKDAT 0x07
+//#define DEBUG
+
+#ifdef DEBUG
+# define SMBUS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
+#else
+# define SMBUS_DPRINTF(format, ...) do { } while (0)
+#endif
+
+
static void smb_transaction(PCSMBus *s)
{
uint8_t prot = (s->smb_ctl >> 2) & 0x07;
@@ -45,9 +54,7 @@ static void smb_transaction(PCSMBus *s)
uint8_t addr = s->smb_addr >> 1;
i2c_bus *bus = s->smbus;
-#ifdef DEBUG
- printf("SMBus trans addr=0x%02x prot=0x%02x\n", addr, prot);
-#endif
+ SMBUS_DPRINTF("SMBus trans addr=0x%02x prot=0x%02x\n", addr, prot);
switch(prot) {
case 0x0:
smbus_quick_command(bus, addr, read);
@@ -96,9 +103,7 @@ void smb_ioport_writeb(void *opaque, uint32_t addr, uint32_t
val)
{
PCSMBus *s = opaque;
addr &= 0x3f;
-#ifdef DEBUG
- printf("SMB writeb port=0x%04x val=0x%02x\n", addr, val);
-#endif
+ SMBUS_DPRINTF("SMB writeb port=0x%04x val=0x%02x\n", addr, val);
switch(addr) {
case SMBHSTSTS:
s->smb_stat = 0;
@@ -166,9 +171,7 @@ uint32_t smb_ioport_readb(void *opaque, uint32_t addr)
val = 0;
break;
}
-#ifdef DEBUG
- printf("SMB readb port=0x%04x val=0x%02x\n", addr, val);
-#endif
+ SMBUS_DPRINTF("SMB readb port=0x%04x val=0x%02x\n", addr, val);
return val;
}
--
1.6.5.4
- [Qemu-devel] [PATCH V10 22/27] pci hotplug: add argument to pci hot plug callback., (continued)
- [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
- [Qemu-devel] [PATCH V10 25/27] acpi_piix4: remove #ifdef DEBUG., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 13/27] pc: split out cpu initialization from pc_init1() into pc_cpus_init()., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 24/27] pc_smbus: remove #ifdef DEBUG.,
Isaku Yamahata <=
- [Qemu-devel] [PATCH V10 26/27] pc_apm: remove #ifdef DEBUG., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 07/27] pc, i440fx: Make smm enable/disable function i440fx independent., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 02/27] acpi: split out apm register emulation from acpi.c, Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 10/27] pc: remove global variable rtc_state by using qemu_irq., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 06/27] pc: initialize ioapic before use., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 14/27] pc: split out memory allocation from pc_init1() into pc_memory_init(), Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 16/27] pc: split out basic device init from pc_init1() into pc_basic_device_init(), Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 18/27] pc: split out piix specific part from pc.c into pc_piix.c, Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 05/27] acpi_piix4: remove unused variable in get_pmsts()., Isaku Yamahata, 2009/12/24
- [Qemu-devel] [PATCH V10 03/27] acpi: add acpi constants from linux header files and use them., Isaku Yamahata, 2009/12/24