From patchwork Tue Jan 5 06:27:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 42202 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 8D321B6EEB for ; Wed, 6 Jan 2010 08:44:02 +1100 (EST) Received: from localhost ([127.0.0.1]:42169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSHC3-00051F-4N for incoming@patchwork.ozlabs.org; Tue, 05 Jan 2010 16:43:59 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSFQ4-0007dP-0G for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:50:20 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSFPy-0007ZU-FE for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:50:19 -0500 Received: from [199.232.76.173] (port=40931 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSFPy-0007ZC-7c for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:50:14 -0500 Received: from mx20.gnu.org ([199.232.41.8]:36255) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSFPx-0003Ef-Ry for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:50:13 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NS2uL-0003p6-W9 for qemu-devel@nongnu.org; Tue, 05 Jan 2010 01:28:46 -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 1688918286; Tue, 5 Jan 2010 15:27:43 +0900 (JST) Received: (nullmailer pid 22694 invoked by uid 1000); Tue, 05 Jan 2010 06:27:50 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Tue, 5 Jan 2010 15:27:48 +0900 Message-Id: <1262672870-22607-26-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1262672870-22607-1-git-send-email-yamahata@valinux.co.jp> References: <1262672870-22607-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 mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH V11 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 e64a2dd..2540626 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);