From patchwork Tue Jun 7 17:38:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 69567 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2096370qgf; Tue, 7 Jun 2016 10:39:14 -0700 (PDT) X-Received: by 10.98.81.3 with SMTP id f3mr599777pfb.132.1465321154237; Tue, 07 Jun 2016 10:39:14 -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.10; Tue, 07 Jun 2016 10:39:14 -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 S1756119AbcFGRjE (ORCPT + 31 others); Tue, 7 Jun 2016 13:39:04 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37681 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756058AbcFGRiz (ORCPT ); Tue, 7 Jun 2016 13:38:55 -0400 Received: by mail-wm0-f53.google.com with SMTP id k204so79273801wmk.0 for ; Tue, 07 Jun 2016 10:38:54 -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=ul0QYL6rFCijAinQnOGdna18P5hpVfZ1F4HRHm97pG0=; b=b0k7Lh2PQbgRoOUoor1kiLCs13Wpu+Ss6Xg72sTfqj6cS9JD9JrKdLq411XCrAQZtV P8+aIkt9w59MyUv1ref7MoiGV7fzXSsPpJAIMJqbse8gdZTG8Juz1i83brw9qJLHja8a szEl9sL4rK3gv1otPxEpxI14ov6QgZJTSZt5g= 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=ul0QYL6rFCijAinQnOGdna18P5hpVfZ1F4HRHm97pG0=; b=Y0vUkc5lz8+0GfpoDGTJIGjxhN0oIBUjbdT3sOjKd1/ZVeUAgG57x6W83GOZu+tQTV egj9hSYFuWtBhSMGeazSladnSqlswQr7ytS3QszVX+W2FhLF1OPu4WCwveGO8tLmQf88 HxtdyfM8ndBqifKWpF6X9J9e5cmgrhkE7l/UI3pcNN79mGFuIdXqWrkN2C/K+ZxBiZla EKGLlExeLBiz1zUO8PSnILLs32Xrym/R9d0hWLovqkXxAdoDW6c8rD6syI9EX4Z5aUe3 fhHqDrCH5H0INe0Y/gurR/JSaXYLBPn37gR6ZCVe7t5zj2zhO/eQDbiGYZsKNRznXNDI +4hw== X-Gm-Message-State: ALyK8tJ6vlmLvdbvrn9xP5rpsak0/qOB6Ydj2+RsrC8RIID9BL24uAo7VQtPDTQD8nmvFYZl X-Received: by 10.28.85.69 with SMTP id j66mr798528wmb.91.1465321133954; Tue, 07 Jun 2016 10:38:53 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jun 2016 10:38:53 -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 5/8] dmaengine: ste_dma40: Only calculate residue if txstate exists. Date: Tue, 7 Jun 2016 18:38:38 +0100 Message-Id: <1465321121-22238-6-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 calculating the residue if there is no txstate to store the value. Signed-off-by: Peter Griffin --- drivers/dma/ste_dma40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 Acked-by: Linus Walleij diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 6fb8307..378cc47 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2588,7 +2588,7 @@ static enum dma_status d40_tx_status(struct dma_chan *chan, } ret = dma_cookie_status(chan, cookie, txstate); - if (ret != DMA_COMPLETE) + if (ret != DMA_COMPLETE && txstate) dma_set_residue(txstate, stedma40_residue(chan)); if (d40_is_paused(d40c))