From patchwork Tue Jun 7 17:38:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 631822 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rPQDY6zJQz9t3k for ; Wed, 8 Jun 2016 07:48:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=I8SH8ECL; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rPQDY5DLbzDrbq for ; Wed, 8 Jun 2016 07:48:29 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=I8SH8ECL; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rPJjp25n8zDq64 for ; Wed, 8 Jun 2016 03:39:58 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=I8SH8ECL; dkim-atps=neutral Received: by mail-wm0-f51.google.com with SMTP id k204so79274611wmk.0 for ; Tue, 07 Jun 2016 10:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ha6iLpetvO3j89x84hjtUdaBasPefK8pWf/MN5I9VhA=; b=I8SH8ECLMCEZEoRQWDEydOkati2yVJ6TojOT2oU4C0y5j0p6N9i8gil+ouRcMnnM+s AeI5hwPSWZYPA9iH5qwz7yRaqtcvFA66TgCz7HZtLn3POWMM6SMwCgMwD/4Zmts0qiXu hpXkjZaN5TZrqgzlgSC5d7ejZ/0i6c4nYFYWc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ha6iLpetvO3j89x84hjtUdaBasPefK8pWf/MN5I9VhA=; b=fcTn50ga3DWZ8A6QBRsDE6YArpzOmU5u1zZ0aXT7aH7Ehr5yxX/c4ebStsme+3+3KG bZ8FXxBC9zGu7nIKipVraaiH6rcWrD6C6PYlirOvwX6IuITrDm1xNpg9wKWpKYKt+ZUq xdMm4aZk1S6NO46+KdOWAcHkzhrxjiwthC7uSGqqO6C6LlRq5ftL4psKIeF1xyCKWbgG wRsa1nljqe1RZw1e9hxeDICp5+D6NvBbPHsOVOx1VvTLcNSzhlge45NDaMRAJ9xmJld3 IBcPXHKc99pFtw+1qcMKQghqkiEZ2lVQzKRDRQUAaMLzBJ2Yp+P7ocMAYnvV7N6x9FCH 0atQ== X-Gm-Message-State: ALyK8tLn2DZPdf0MOvO7HTK9wr08ZBSUx4AYzTgL/3pFq0ujxcmrK4u+E2kfBVey0r6rykJD X-Received: by 10.194.84.39 with SMTP id v7mr550824wjy.74.1465321135484; Tue, 07 Jun 2016 10:38:55 -0700 (PDT) Received: from localhost.localdomain (cpc84731-aztw28-2-0-cust112.18-1.cable.virginm.net. [82.37.67.113]) by smtp.gmail.com with ESMTPSA id h8sm1310031wjg.9.2016.06.07.10.38.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jun 2016 10:38:54 -0700 (PDT) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, vinod.koul@intel.com, linus.walleij@linaro.org, dan.j.williams@intel.com, leoli@freescale.com, zw@zh-kernel.org, baohua@kernel.org, maxime.ripard@free-electrons.com, wens@csie.org, ldewangan@nvidia.com, jonathanh@nvidia.com, swarren@wwwdotorg.org, thierry.reding@gmail.com, gnurou@gmail.com Subject: [PATCH 6/8] dmaengine: sun6i-dma: Only calculate residue if state exists. Date: Tue, 7 Jun 2016 18:38:39 +0100 Message-Id: <1465321121-22238-7-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465321121-22238-1-git-send-email-peter.griffin@linaro.org> References: <1465321121-22238-1-git-send-email-peter.griffin@linaro.org> X-Mailman-Approved-At: Wed, 08 Jun 2016 07:37:26 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.griffin@linaro.org, dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, lee.jones@linaro.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" There is no point in calculating the residue if state does not exist to store the value. Signed-off-by: Peter Griffin --- drivers/dma/sun6i-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index 5065ca4..3835fcd 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -865,7 +865,7 @@ static enum dma_status sun6i_dma_tx_status(struct dma_chan *chan, size_t bytes = 0; ret = dma_cookie_status(chan, cookie, state); - if (ret == DMA_COMPLETE) + if (ret == DMA_COMPLETE || !state) return ret; spin_lock_irqsave(&vchan->vc.lock, flags);