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: 69566 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2096354qgf; Tue, 7 Jun 2016 10:39:10 -0700 (PDT) X-Received: by 10.107.59.200 with SMTP id i191mr1718854ioa.24.1465321150340; Tue, 07 Jun 2016 10:39:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 199si35893380pfz.17.2016.06.07.10.39.06; Tue, 07 Jun 2016 10:39:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756104AbcFGRjB (ORCPT + 31 others); Tue, 7 Jun 2016 13:39:01 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38837 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756078AbcFGRi4 (ORCPT ); Tue, 7 Jun 2016 13:38:56 -0400 Received: by mail-wm0-f51.google.com with SMTP id m124so124423997wme.1 for ; Tue, 07 Jun 2016 10:38:56 -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=I8DFRCUY2Q+HHL+xWSDr+bXGhglON9O1C+YjI4YMEAUyM5cj+zettXTgV6nxNW0B5x P/TUNYun3JZQVakvad5BQoTVIQAp4ZuNUetH2Jn4duSt9I1oupYQafhKApuGcqDZN160 jkZ++gbwoiEPuWJw1zESM4toMP5+qiAChPRnd0XWZEHN9sRIBjaXWdOoNVqpKEWEr2Id fGg0OkAhsH+5G27Tqpc57obWLamuTzMr4INvekamGzyqa+YFJqeJ7qxPWB576TmCFobG K5w1pmUJi29U1dzMcti/XJDl7I74dQuw6n7E2I/kpfzhvsWF4Uqcz4Lx6aQLrMegQa1q etFQ== X-Gm-Message-State: ALyK8tJIaXVvZoHv06e4ny8I4JUBGTJ458176055Re8x9uPmtSULZ+hH+cafXVrU9uw3+bLZ 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 Cc: peter.griffin@linaro.org, lee.jones@linaro.org, dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, linuxppc-dev@lists.ozlabs.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.9.1 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);