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: 631821 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 3rPQBj02P4z9t3k for ; Wed, 8 Jun 2016 07:46:53 +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=b0k7Lh2P; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rPQBh62wTzDrSS for ; Wed, 8 Jun 2016 07:46:52 +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=b0k7Lh2P; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) (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 3rPJjm5XqvzDq64 for ; Wed, 8 Jun 2016 03:39:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=b0k7Lh2P; dkim-atps=neutral Received: by mail-wm0-f53.google.com with SMTP id m124so124423080wme.1 for ; Tue, 07 Jun 2016 10:39: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=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=IBX6qq1bPVJCFQoB69IxoIBOQY5rD1LqGxoJH7Fb0P76gbt8TIaa5QJsYeKT22JblU xihSVp2SpX8DyMO0hKvdxqmPeZqVp8E4K7yOa8/9/Dd4vfT4QRPHVJW4R136tZe99Ukh oPoyAPjkaymOyrGMoBJwplg1SHmXGlSjbeERFRO2/a4Mg4NhfgWUACVXAvG81SF8NX3T q/UaGRN1q+GRQP95SzpWqE9ujqgoSGtAW/fkkBJP3OxYvdRFmK4lMp7XbOm44mOF329e PfHxx1X3r+rS+Mrm6TqwrZvun0TvNLFvrLwwdA5sEmPiN+LmSwT7pymBsklLc5BIdxx4 8S7g== X-Gm-Message-State: ALyK8tJQJmNyBysElZzUwVGY7goVG+sFWPcdBvwx2sFLp2gJ4UuOtlHlG0rexkHoBHnOObbh 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 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> 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 calculating the residue if there is no txstate to store the value. Signed-off-by: Peter Griffin Acked-by: Linus Walleij --- drivers/dma/ste_dma40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))