Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1098110imm; Tue, 3 Jul 2018 05:35:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfcRDB5cIDzDSJGjJNidhbJ2clcUDLv5kfCxIya5xZ3tCboHgU1dkEPXNXCZzrZCwds2sPu X-Received: by 2002:a62:6eca:: with SMTP id j193-v6mr10173032pfc.256.1530621352291; Tue, 03 Jul 2018 05:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530621352; cv=none; d=google.com; s=arc-20160816; b=BH8zzctSj0uOdkD4EjSR6tps8JbnZpjzPaPj8v5tY0c49H0k+byBo83cpdvt3MCDDD eaQ9iMjTAmg/NmwWFhRDkNI3z44ecmfmI01N5u3DESWw9Zi50sjtvQphbrdACMEdwAh3 8bQ2e9CsBIAjs6KUGFYZnwJJ2bYc1JgCtcXigfgSXNy8eXCL/WlVFXslCBWWyuIsusOZ ezQ5YbLxPWNsXjfteQcpn1dP3CVdYw1JKhzmIPeMUBIa0n+Km+rf2XsM+eRUozRCWlga pfR4AYwBgG7a0bkweFriaQLjUqljCynabEQujue6U8v5Wrr+TGJNBvoPTo+HqJuDsvYm 7niw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=etNvu++QjGMWLSYkyKc75Q73fElUynmKAMsXw0ay0Is=; b=CdEUfEsiUfYrCidG+l5fnPEwAElk72rwlcoej9H8KtdPoKTK58UBl4t0n8xtB+t2vJ UVB2nnfoQsQnhqfApnH/r/PEWzYpV8BfAKIbghDrOIFkvMcaggiaTaL1Eq5aNVFrLZQK pcuwadSL1g3InYy9N4bwko0iTtati5KiuGPZ4tB/Q01/kC7gq12PrkoXNJxw8tH52xFT JUhL5k/e7a3VmKwaAsU/s2qWazCtHmmuYj2pRE3SLSp14n4N3fdd1N+9aPkLzKn88B1M FUJItJUFGos5hUN4kFhIfgmuqD+yR9JbsjFlNo4vEJ3vuL7SvYQn/MTjx5IVr/v2GFlp MC2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=OkwR0CB9; 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 sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14-v6si1146683plt.382.2018.07.03.05.35.37; Tue, 03 Jul 2018 05:35:52 -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=@crapouillou.net header.s=mail header.b=OkwR0CB9; 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 sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753439AbeGCMdt (ORCPT + 99 others); Tue, 3 Jul 2018 08:33:49 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:46646 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753370AbeGCMck (ORCPT ); Tue, 3 Jul 2018 08:32:40 -0400 From: Paul Cercueil To: Vinod Koul , Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , James Hogan , Zubair Lutfullah Kakakhel Cc: Mathieu Malaterre , Daniel Silsby , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: [PATCH 09/14] dmaengine: dma-jz4780: Simplify jz4780_dma_desc_residue() Date: Tue, 3 Jul 2018 14:32:09 +0200 Message-Id: <20180703123214.23090-10-paul@crapouillou.net> In-Reply-To: <20180703123214.23090-1-paul@crapouillou.net> References: <20180703123214.23090-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1530621158; bh=etNvu++QjGMWLSYkyKc75Q73fElUynmKAMsXw0ay0Is=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=OkwR0CB9cT0+gfYUB8sMtFmrDXVPWxPBzimqmqhmoxSZ5xxuupMw8jN1QKXx0q6GRWm4cnWpLBj/nU+t69N4ITEzT2my/2jXOoIogG5+Xz/lY0GZFGJJUc7ZvT1I5POlFapn5Yp07NResKdQATkk2aZn7Oyeam0tJcMBeEkQJ6Q= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Silsby Simple cleanup, no changes to actual logic here. Signed-off-by: Daniel Silsby --- drivers/dma/dma-jz4780.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 7b2e305e28fb..adada2a3a067 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -604,22 +604,17 @@ static size_t jz4780_dma_desc_residue(struct jz4780_dma_chan *jzchan, struct jz4780_dma_desc *desc, unsigned int next_sg) { struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); - unsigned int residue, count; + unsigned int count = 0; unsigned int i; - residue = 0; - for (i = next_sg; i < desc->count; i++) - residue += (desc->desc[i].dtc & 0xffffff) << - jzchan->transfer_shift; + count += desc->desc[i].dtc & 0xffffff; - if (next_sg != 0) { - count = jz4780_dma_chn_readl(jzdma, jzchan->id, + if (next_sg != 0) + count += jz4780_dma_chn_readl(jzdma, jzchan->id, JZ_DMA_REG_DTC); - residue += count << jzchan->transfer_shift; - } - return residue; + return count << jzchan->transfer_shift; } static enum dma_status jz4780_dma_tx_status(struct dma_chan *chan, -- 2.18.0