From patchwork Sun Aug 11 17:59:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2842776 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E9E529F294 for ; Sun, 11 Aug 2013 18:01:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A48C20276 for ; Sun, 11 Aug 2013 18:01:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1F4A20255 for ; Sun, 11 Aug 2013 18:01:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Zws-0006nQ-8A; Sun, 11 Aug 2013 18:01:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Zwd-0006hg-Ej; Sun, 11 Aug 2013 18:00:47 +0000 Received: from mail-bk0-x22d.google.com ([2a00:1450:4008:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V8Zw5-0006Zb-Cb for linux-arm-kernel@lists.infradead.org; Sun, 11 Aug 2013 18:00:15 +0000 Received: by mail-bk0-f45.google.com with SMTP id mx11so1556028bkb.4 for ; Sun, 11 Aug 2013 10:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gwukSemnD5p2uwHsZSrd6iVcNxUxZaWzWvsbK0mArDg=; b=k+zH0ccdjiF9hRVHRJqB/WKEOOGIgv7vy5HBkTlNuXTUQSd7HjjON+asZRTyMu32Wz eI85q0kpwfOYPgAlAGIjhONEinNlB6YG4mPi+vxtM0QZX1FasPkTcCGbUlTmPQUICU5N zZD2+0Hz4mibmMmBFzO3wE3svDrxaxuSrWoljCclraB+/MO572s6FBUcPTtiFDRXl1oP f3K7558SOYEBsaffGHNPUwBmzV/RyRJYe/9nkLecpFE/j/HgUEte/MyY2X+TzBeOlaoh we+NFE1xSjXKRqB5BIW3ca/AvaGOg7vrwS62PunpsjgANnPgi1R0x20UzIwZ2ehitbhv vF1g== X-Received: by 10.205.19.6 with SMTP id qi6mr3181416bkb.182.1376243991513; Sun, 11 Aug 2013 10:59:51 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id nv4sm4838824bkb.3.2013.08.11.10.59.49 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 Aug 2013 10:59:50 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 04/18] dmaengine: PL08x: Move LLI dumping code into separate function Date: Sun, 11 Aug 2013 19:59:16 +0200 Message-Id: <1376243970-6489-5-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1376243970-6489-1-git-send-email-tomasz.figa@gmail.com> References: <1376243970-6489-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130811_140013_656508_7D8CDAC7 X-CRM114-Status: GOOD ( 13.17 ) X-Spam-Score: -2.0 (--) Cc: alsa-devel@alsa-project.org, Kukjin Kim , Mike Turquette , Liam Girdwood , Sangbeom Kim , Vinod Koul , Linus Walleij , Padmavathi Venna , linux-kernel@vger.kernel.org, Jaroslav Kysela , Takashi Iwai , Mark Brown , Dan Williams , Russell King , linux-spi@vger.kernel.org, Tomasz Figa , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch refactors debugging code that dumps LLI entries by moving it into separate function, which is stubbed when VERBOSE_DEBUG is not selected. This allows us to get rid of the ugly ifdef from the body of pl08x_fill_llis_for_desc(). No functional change is introduced by this patch. Signed-off-by: Tomasz Figa Reviewed-by: Linus Walleij --- drivers/dma/amba-pl08x.c | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index d3399c2..1fa05d6 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -814,6 +814,29 @@ static inline void prep_byte_width_lli(struct pl08x_driver_data *pl08x, (*total_bytes) += len; } +#ifdef VERBOSE_DEBUG +static void pl08x_dump_lli(struct pl08x_driver_data *pl08x, + const u32 *llis_va, int num_llis) +{ + int i; + + dev_vdbg(&pl08x->adev->dev, + "%-3s %-9s %-10s %-10s %-10s %s\n", + "lli", "", "csrc", "cdst", "clli", "cctl"); + for (i = 0; i < num_llis; i++) { + dev_vdbg(&pl08x->adev->dev, + "%3d @%p: 0x%08x 0x%08x 0x%08x 0x%08x\n", + i, llis_va, llis_va[PL080_LLI_SRC], + llis_va[PL080_LLI_DST], llis_va[PL080_LLI_LLI], + llis_va[PL080_LLI_CCTL]); + llis_va += pl08x->lli_words; + } +} +#else +static inline void pl08x_dump_lli(struct pl08x_driver_data *pl08x, + const u32 *llis_va, int num_llis) {} +#endif + /* * This fills in the table of LLIs for the transfer descriptor * Note that we assume we never have to change the burst sizes @@ -1033,23 +1056,7 @@ static int pl08x_fill_llis_for_desc(struct pl08x_driver_data *pl08x, /* The final LLI element shall also fire an interrupt. */ last_lli[PL080_LLI_CCTL] |= PL080_CONTROL_TC_IRQ_EN; -#ifdef VERBOSE_DEBUG - { - int i; - - dev_vdbg(&pl08x->adev->dev, - "%-3s %-9s %-10s %-10s %-10s %s\n", - "lli", "", "csrc", "cdst", "clli", "cctl"); - for (i = 0; i < num_llis; i++) { - dev_vdbg(&pl08x->adev->dev, - "%3d @%p: 0x%08x 0x%08x 0x%08x 0x%08x\n", - i, llis_va, llis_va[PL080_LLI_SRC], - llis_va[PL080_LLI_DST], llis_va[PL080_LLI_LLI], - llis_va[PL080_LLI_CCTL]); - llis_va += pl08x->lli_words; - } - } -#endif + pl08x_dump_lli(pl08x, llis_va, num_llis); return num_llis; }