From patchwork Thu Dec 24 08:09:18 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 41755 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 240A5B7BF8 for ; Thu, 24 Dec 2009 19:53:23 +1100 (EST) Received: from localhost ([127.0.0.1]:60445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNjRg-0006hv-69 for incoming@patchwork.ozlabs.org; Thu, 24 Dec 2009 03:53:20 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNilX-00028r-5r for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNilN-0001zH-5a for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:43 -0500 Received: from [199.232.76.173] (port=42927 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNilH-0001xO-19 for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:31 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:39726) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNilF-0004VZ-2j for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:29 -0500 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 6148E106ABA; Thu, 24 Dec 2009 17:09:22 +0900 (JST) Received: (nullmailer pid 22833 invoked by uid 1000); Thu, 24 Dec 2009 08:09:20 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Thu, 24 Dec 2009 17:09:18 +0900 Message-Id: <1261642160-22754-26-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1261642160-22754-1-git-send-email-yamahata@valinux.co.jp> References: <1261642160-22754-1-git-send-email-yamahata@valinux.co.jp> X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH V10 25/27] acpi_piix4: remove #ifdef DEBUG. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org removed #ifdef DEBUG by using macro. Signed-off-by: Isaku Yamahata --- hw/acpi_piix4.c | 54 ++++++++++++++++++------------------------------------ 1 files changed, 18 insertions(+), 36 deletions(-) diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index 59a4d0f..aa63f0e 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -29,6 +29,12 @@ //#define DEBUG +#ifdef DEBUG +# define PIIX4_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) +#else +# define PIIX4_DPRINTF(format, ...) do { } while (0) +#endif + #define ACPI_DBG_IO_ADDR 0xb044 #define GPE_BASE 0xafe0 @@ -170,9 +176,7 @@ static void pm_ioport_writew(void *opaque, uint32_t addr, uint32_t val) default: break; } -#ifdef DEBUG - printf("PM writew port=0x%04x val=0x%04x\n", addr, val); -#endif + PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", addr, val); } static uint32_t pm_ioport_readw(void *opaque, uint32_t addr) @@ -195,9 +199,7 @@ static uint32_t pm_ioport_readw(void *opaque, uint32_t addr) val = 0; break; } -#ifdef DEBUG - printf("PM readw port=0x%04x val=0x%04x\n", addr, val); -#endif + PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", addr, val); return val; } @@ -205,9 +207,7 @@ static void pm_ioport_writel(void *opaque, uint32_t addr, uint32_t val) { // PIIX4PMState *s = opaque; addr &= 0x3f; -#ifdef DEBUG - printf("PM writel port=0x%04x val=0x%08x\n", addr, val); -#endif + PIIX4_DPRINTF("PM writel port=0x%04x val=0x%08x\n", addr, val); } static uint32_t pm_ioport_readl(void *opaque, uint32_t addr) @@ -224,9 +224,7 @@ static uint32_t pm_ioport_readl(void *opaque, uint32_t addr) val = 0; break; } -#ifdef DEBUG - printf("PM readl port=0x%04x val=0x%08x\n", addr, val); -#endif + PIIX4_DPRINTF("PM readl port=0x%04x val=0x%08x\n", addr, val); return val; } @@ -248,9 +246,7 @@ static void apm_ctrl_changed(uint32_t val, void *arg) static void acpi_dbg_writel(void *opaque, uint32_t addr, uint32_t val) { -#if defined(DEBUG) - printf("ACPI: DBG: 0x%08x\n", val); -#endif + PIIX4_DPRINTF("ACPI: DBG: 0x%08x\n", val); } static void pm_io_space_update(PIIX4PMState *s) @@ -262,9 +258,7 @@ static void pm_io_space_update(PIIX4PMState *s) pm_io_base &= 0xffc0; /* XXX: need to improve memory and ioport allocation */ -#if defined(DEBUG) - printf("PM: mapping to 0x%x\n", pm_io_base); -#endif + PIIX4_DPRINTF("PM: mapping to 0x%x\n", pm_io_base); register_ioport_write(pm_io_base, 64, 2, pm_ioport_writew, s); register_ioport_read(pm_io_base, 64, 2, pm_ioport_readw, s); register_ioport_write(pm_io_base, 64, 4, pm_ioport_writel, s); @@ -450,9 +444,7 @@ static uint32_t gpe_readb(void *opaque, uint32_t addr) break; } -#if defined(DEBUG) - printf("gpe read %x == %x\n", addr, val); -#endif + PIIX4_DPRINTF("gpe read %x == %x\n", addr, val); return val; } @@ -492,9 +484,7 @@ static void gpe_writeb(void *opaque, uint32_t addr, uint32_t val) break; } -#if defined(DEBUG) - printf("gpe write %x <== %d\n", addr, val); -#endif + PIIX4_DPRINTF("gpe write %x <== %d\n", addr, val); } static uint32_t pcihotplug_read(void *opaque, uint32_t addr) @@ -512,9 +502,7 @@ static uint32_t pcihotplug_read(void *opaque, uint32_t addr) break; } -#if defined(DEBUG) - printf("pcihotplug read %x == %x\n", addr, val); -#endif + PIIX4_DPRINTF("pcihotplug read %x == %x\n", addr, val); return val; } @@ -530,16 +518,12 @@ static void pcihotplug_write(void *opaque, uint32_t addr, uint32_t val) break; } -#if defined(DEBUG) - printf("pcihotplug write %x <== %d\n", addr, val); -#endif + PIIX4_DPRINTF("pcihotplug write %x <== %d\n", addr, val); } static uint32_t pciej_read(void *opaque, uint32_t addr) { -#if defined(DEBUG) - printf("pciej read %x\n", addr); -#endif + PIIX4_DPRINTF("pciej read %x\n", addr); return 0; } @@ -558,9 +542,7 @@ static void pciej_write(void *opaque, uint32_t addr, uint32_t val) } -#if defined(DEBUG) - printf("pciej write %x <== %d\n", addr, val); -#endif + PIIX4_DPRINTF("pciej write %x <== %d\n", addr, val); } static int piix4_device_hotplug(void *opaque, PCIDevice *dev, int state);