From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk6lj-0004YV-Uz for qemu-devel@nongnu.org; Tue, 13 May 2014 03:05:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk6la-00016m-Tv for qemu-devel@nongnu.org; Tue, 13 May 2014 03:04:55 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:53601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk6la-00016f-Nh for qemu-devel@nongnu.org; Tue, 13 May 2014 03:04:46 -0400 Received: by mail-wg0-f44.google.com with SMTP id a1so7958478wgh.27 for ; Tue, 13 May 2014 00:04:46 -0700 (PDT) From: =?UTF-8?q?Marc=20Mar=C3=AD?= Date: Tue, 13 May 2014 09:02:51 +0200 Message-Id: <1399964572-5376-16-git-send-email-marc.mari.barcelo@gmail.com> In-Reply-To: <1399964572-5376-1-git-send-email-marc.mari.barcelo@gmail.com> References: <1399964572-5376-1-git-send-email-marc.mari.barcelo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v2 15/16] pci-host: Convert conditional compilation of debug printfs to regular ifs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc=20Mar=C3=AD?= , Stefan Hajnoczi , Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= Modify debug macros to have the same format through the codebase and use regular ifs instead of ifdef. As the debug printf is always put in code, some casting had to be added to avoid warnings treated as errors at compile time. Signed-off-by: Marc MarĂ­ --- hw/pci-host/bonito.c | 10 ++++++---- hw/pci-host/ppce500.c | 8 ++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 902441f..4a1dd20 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -50,11 +50,13 @@ //#define DEBUG_BONITO #ifdef DEBUG_BONITO -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__) +#define DEBUG_BONITO_ENABLED 1 #else -#define DPRINTF(fmt, ...) +#define DEBUG_BONITO_ENABLED 0 #endif +#define DPRINTF(fmt, ...) QEMU_DPRINTF(DEBUG_BONITO_ENABLED, "bonito", fmt, ## __VA_ARGS__) + /* from linux soure code. include/asm-mips/mips-boards/bonito64.h*/ #define BONITO_BOOT_BASE 0x1fc00000 #define BONITO_BOOT_SIZE 0x00100000 @@ -235,7 +237,7 @@ static void bonito_writel(void *opaque, hwaddr addr, saddr = (addr - BONITO_REGBASE) >> 2; - DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, val, saddr); + DPRINTF("bonito_writel "TARGET_FMT_plx" val %x saddr %x\n", addr, (unsigned)val, saddr); switch (saddr) { case BONITO_BONPONCFG: case BONITO_IODEVCFG: @@ -322,7 +324,7 @@ static void bonito_pciconf_writel(void *opaque, hwaddr addr, PCIBonitoState *s = opaque; PCIDevice *d = PCI_DEVICE(s); - DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %x\n", addr, val); + DPRINTF("bonito_pciconf_writel "TARGET_FMT_plx" val %x\n", addr, (unsigned)val); d->config_write(d, addr, val, 4); } diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index c80b7cb..dfeb19e 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -21,12 +21,16 @@ #include "qemu/bswap.h" #include "hw/pci-host/ppce500.h" +//#define DEBUG_PCI + #ifdef DEBUG_PCI -#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) +#define DEBUG_PCI_ENABLED 1 #else -#define pci_debug(fmt, ...) +#define DEBUG_PCI_ENABLED 0 #endif +#define pci_debug(fmt, ...) QEMU_DPRINTF(DEBUG_PCI_ENABLED, "ppce500", fmt, ## __VA_ARGS__) + #define PCIE500_CFGADDR 0x0 #define PCIE500_CFGDATA 0x4 #define PCIE500_REG_BASE 0xC00 -- 1.7.10.4