mirror of https://github.com/xqemu/xqemu.git
pm_smbus: remove #ifdef DEBUG.
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>
This commit is contained in:
parent
ac4040955b
commit
b246eebb0a
|
@ -37,6 +37,15 @@
|
||||||
#define SMBHSTDAT1 0x06
|
#define SMBHSTDAT1 0x06
|
||||||
#define SMBBLKDAT 0x07
|
#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(PMSMBus *s)
|
static void smb_transaction(PMSMBus *s)
|
||||||
{
|
{
|
||||||
uint8_t prot = (s->smb_ctl >> 2) & 0x07;
|
uint8_t prot = (s->smb_ctl >> 2) & 0x07;
|
||||||
|
@ -45,9 +54,7 @@ static void smb_transaction(PMSMBus *s)
|
||||||
uint8_t addr = s->smb_addr >> 1;
|
uint8_t addr = s->smb_addr >> 1;
|
||||||
i2c_bus *bus = s->smbus;
|
i2c_bus *bus = s->smbus;
|
||||||
|
|
||||||
#ifdef DEBUG
|
SMBUS_DPRINTF("SMBus trans addr=0x%02x prot=0x%02x\n", addr, prot);
|
||||||
printf("SMBus trans addr=0x%02x prot=0x%02x\n", addr, prot);
|
|
||||||
#endif
|
|
||||||
switch(prot) {
|
switch(prot) {
|
||||||
case 0x0:
|
case 0x0:
|
||||||
smbus_quick_command(bus, addr, read);
|
smbus_quick_command(bus, addr, read);
|
||||||
|
@ -96,9 +103,7 @@ void smb_ioport_writeb(void *opaque, uint32_t addr, uint32_t val)
|
||||||
{
|
{
|
||||||
PMSMBus *s = opaque;
|
PMSMBus *s = opaque;
|
||||||
addr &= 0x3f;
|
addr &= 0x3f;
|
||||||
#ifdef DEBUG
|
SMBUS_DPRINTF("SMB writeb port=0x%04x val=0x%02x\n", addr, val);
|
||||||
printf("SMB writeb port=0x%04x val=0x%02x\n", addr, val);
|
|
||||||
#endif
|
|
||||||
switch(addr) {
|
switch(addr) {
|
||||||
case SMBHSTSTS:
|
case SMBHSTSTS:
|
||||||
s->smb_stat = 0;
|
s->smb_stat = 0;
|
||||||
|
@ -166,9 +171,7 @@ uint32_t smb_ioport_readb(void *opaque, uint32_t addr)
|
||||||
val = 0;
|
val = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
SMBUS_DPRINTF("SMB readb port=0x%04x val=0x%02x\n", addr, val);
|
||||||
printf("SMB readb port=0x%04x val=0x%02x\n", addr, val);
|
|
||||||
#endif
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue