From patchwork Thu Dec 24 08:09:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 41745 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 880E5B7BF5 for ; Thu, 24 Dec 2009 19:32:18 +1100 (EST) Received: from localhost ([127.0.0.1]:46316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNj7H-0006IE-Lc for incoming@patchwork.ozlabs.org; Thu, 24 Dec 2009 03:32:15 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNilQ-000238-9r for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNilF-0001wY-QO for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:33 -0500 Received: from [199.232.76.173] (port=42924 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNilF-0001w8-DR for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:29 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:39728) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNilF-0004Vd-0z 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 AC6D3106ABC; Thu, 24 Dec 2009 17:09:22 +0900 (JST) Received: (nullmailer pid 22837 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:20 +0900 Message-Id: <1261642160-22754-28-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 27/27] mc146818rtc: remove #ifdef DEBUG_CMOS. 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 remove #ifdef DEBUG_CMOS by using macro. Signed-off-by: Isaku Yamahata --- hw/mc146818rtc.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 1eb991c..0e1dc07 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -31,6 +31,12 @@ //#define DEBUG_CMOS +#ifdef DEBUG_CMOS +# define CMOS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) +#else +# define CMOS_DPRINTF(format, ...) do { } while (0) +#endif + #define RTC_REINJECT_ON_ACK_COUNT 1000 #define RTC_SECONDS 0 @@ -210,10 +216,8 @@ static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data) if ((addr & 1) == 0) { s->cmos_index = data & 0x7f; } else { -#ifdef DEBUG_CMOS - printf("cmos: write index=0x%02x val=0x%02x\n", - s->cmos_index, data); -#endif + CMOS_DPRINTF("cmos: write index=0x%02x val=0x%02x\n", + s->cmos_index, data); switch(s->cmos_index) { case RTC_SECONDS_ALARM: case RTC_MINUTES_ALARM: @@ -482,10 +486,8 @@ static uint32_t cmos_ioport_read(void *opaque, uint32_t addr) ret = s->cmos_data[s->cmos_index]; break; } -#ifdef DEBUG_CMOS - printf("cmos: read index=0x%02x val=0x%02x\n", - s->cmos_index, ret); -#endif + CMOS_DPRINTF("cmos: read index=0x%02x val=0x%02x\n", + s->cmos_index, ret); return ret; } }