From patchwork Wed Jan 6 02:39:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 42254 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 6DA61B6EF0 for ; Wed, 6 Jan 2010 13:53:28 +1100 (EST) Received: from localhost ([127.0.0.1]:37929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSM1V-00009t-MJ for incoming@patchwork.ozlabs.org; Tue, 05 Jan 2010 21:53:25 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSLog-0004Pu-3Q for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:40:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSLoS-0004Gx-KY for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:40:00 -0500 Received: from [199.232.76.173] (port=54787 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSLoR-0004GS-U4 for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:39:56 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:60925) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSLoP-0003kN-Tj for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:39:55 -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 3CF8318299; Wed, 6 Jan 2010 11:39:44 +0900 (JST) Received: (nullmailer pid 28776 invoked by uid 1000); Wed, 06 Jan 2010 02:39:52 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kraxel@redhat.com, aurelien@aurel32.net Date: Wed, 6 Jan 2010 11:39:49 +0900 Message-Id: <1262745591-28697-26-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1262745591-28697-1-git-send-email-yamahata@valinux.co.jp> References: <1262745591-28697-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 V12 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 Acked-by: Gerd Hoffmann --- 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 e448143..bc32c3b 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(DeviceState *qdev, PCIDevice *dev, int state);