From patchwork Tue Jun 7 17:38:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 69565 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2096327qgf; Tue, 7 Jun 2016 10:39:05 -0700 (PDT) X-Received: by 10.36.121.202 with SMTP id z193mr6005793itc.9.1465321145796; Tue, 07 Jun 2016 10:39:05 -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.38.59; Tue, 07 Jun 2016 10:39:05 -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 S1756076AbcFGRi4 (ORCPT + 31 others); Tue, 7 Jun 2016 13:38:56 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37646 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756053AbcFGRiw (ORCPT ); Tue, 7 Jun 2016 13:38:52 -0400 Received: by mail-wm0-f54.google.com with SMTP id k204so79272187wmk.0 for ; Tue, 07 Jun 2016 10:38:51 -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=/8ZzXkjRzjYqAtdY8JKqOrgJ3k9GVY0Mo3EUyEZQd3Y=; b=PqswbxmGRKM6BEI+kouiRpm4R/0KINACaS0F42xvzxLn2FJLOaOtG+kUQ2A5+GY6OT aBgc3TZ0iU0anFy7WjtniY/vb5abubaM73pRcWdgMfCMxcWSb4Q90Vi+vXkJWbhHjD97 9HKb0G7xxAZVbQKjIo0SuMTCS+ptkaqz1cbdk= 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=/8ZzXkjRzjYqAtdY8JKqOrgJ3k9GVY0Mo3EUyEZQd3Y=; b=FzrgQCB5n/jfICkxJTXjdPXAJ84OXQtwdOSh6T16q7xBt4ooZ4xn9F78jyh7lywMdu 2hP4/a+Ll2vGUPeaQQjCmIIVGPpWgXTN93ZXfyGQgTRb5SOt6ggGmE++hpN9nnrGd/Co h5aaT+doegmciF3wo9Tvm9n1eFOnSsDqzOwVo/BvbOkf1BfvGVK7dw2KB6/S44rGCYKO GLg5fj/56663VVh+dPQQnvYc12h2KLBg4uDxW3P60m+/P4kJiUsPwkqqFgk1T8Qq1gWY UdLZLS6XmStagCQIl2uo6RxKrBKB7N8271HNqPnz67XkmSZ4hq4f07s/9kI92CfMmC+4 FAAw== X-Gm-Message-State: ALyK8tJcoOaRIqyLvZUKU+OikS9KRjMT7twc/+Ft4O2vs25nN3chlZAX7wCp/qJjf3eFGKJT X-Received: by 10.194.121.202 with SMTP id lm10mr533897wjb.134.1465321131003; Tue, 07 Jun 2016 10:38:51 -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.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jun 2016 10:38:49 -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 3/8] dmaengine: coh901318: Only calculate residue if txstate exists. Date: Tue, 7 Jun 2016 18:38:36 +0100 Message-Id: <1465321121-22238-4-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 there is no txstate to store the value. Signed-off-by: Peter Griffin --- drivers/dma/coh901318.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 Acked-by: Linus Walleij diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index c340ca9..c100616 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -2422,7 +2422,7 @@ coh901318_tx_status(struct dma_chan *chan, dma_cookie_t cookie, enum dma_status ret; ret = dma_cookie_status(chan, cookie, txstate); - if (ret == DMA_COMPLETE) + if (ret == DMA_COMPLETE || !txstate) return ret; dma_set_residue(txstate, coh901318_get_bytes_left(chan));