From patchwork Mon Jul 18 04:38:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 649323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rt9TV6Qccz9s9N for ; Mon, 18 Jul 2016 14:40:30 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b=PYHlZa5I; dkim-atps=neutral Received: from localhost ([::1]:44255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP0Lx-0006r7-2g for incoming@patchwork.ozlabs.org; Mon, 18 Jul 2016 00:40:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP0KZ-0005dl-3m for qemu-devel@nongnu.org; Mon, 18 Jul 2016 00:39:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP0KX-0005bn-3r for qemu-devel@nongnu.org; Mon, 18 Jul 2016 00:38:58 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:34428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP0KW-0005ah-6x; Mon, 18 Jul 2016 00:38:57 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3rt9Rc5tn9z9s9N; Mon, 18 Jul 2016 14:38:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1468816732; bh=hJvjfTuQ8TwaAOo3eGLL4ZRv5VxK3XRNQqr81R/hkgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PYHlZa5ItUYMkx5MKKFZRZzeG/NLVn8+pzOagSgoEwAWa2cyFIT13vh27uQBOgm5u SiYf0dC/WlOzKXW7BmADTFQTVvgxPaHP79ju4AcC/2O8l2ffhnch2quolIR0JgsLHk iGEN+jnryo86e2eHhnX/3JCj7uM6CkV7yxwLSc0o= From: David Gibson To: peter.maydell@linaro.org Date: Mon, 18 Jul 2016 14:38:38 +1000 Message-Id: <1468816730-22957-3-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468816730-22957-1-git-send-email-david@gibson.dropbear.id.au> References: <1468816730-22957-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 02/14] dbdma: always define DBDMA_DPRINTF and enable debug with DEBUG_DBDMA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aik@ozlabs.ru, Mark Cave-Ayland , agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Enabling DBDMA_DPRINTF unconditionally ensures that any errors in debug statements are picked up immediately. Signed-off-by: Mark Cave-Ayland Acked-by: Benjamin Herrenschmidt Signed-off-by: David Gibson --- hw/misc/macio/mac_dbdma.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c index f116f9c..b6639f4 100644 --- a/hw/misc/macio/mac_dbdma.c +++ b/hw/misc/macio/mac_dbdma.c @@ -45,14 +45,13 @@ #include "sysemu/dma.h" /* debug DBDMA */ -//#define DEBUG_DBDMA +#define DEBUG_DBDMA 0 -#ifdef DEBUG_DBDMA -#define DBDMA_DPRINTF(fmt, ...) \ - do { printf("DBDMA: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DBDMA_DPRINTF(fmt, ...) -#endif +#define DBDMA_DPRINTF(fmt, ...) do { \ + if (DEBUG_DBDMA) { \ + printf("DBDMA: " fmt , ## __VA_ARGS__); \ + } \ +} while (0); /* */ @@ -62,7 +61,7 @@ static DBDMAState *dbdma_from_ch(DBDMA_channel *ch) return container_of(ch, DBDMAState, channels[ch->channel]); } -#ifdef DEBUG_DBDMA +#if DEBUG_DBDMA static void dump_dbdma_cmd(dbdma_cmd *cmd) { printf("dbdma_cmd %p\n", cmd);