All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	dmaengine@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: [PATCH v3 4/5] dmaengine: sh: rz-dmac: Trivial code clean-ups
Date: Wed, 12 Apr 2023 16:24:44 +0100	[thread overview]
Message-ID: <20230412152445.117439-5-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20230412152445.117439-1-biju.das.jz@bp.renesas.com>

Drop unnecessary lmdesc invalidation in rz_dmac_lmdesc_recycle()
as the lmdesc is already invalidated.

Drop redundant assignment of i to "0" and change the variable
type of "i" to unsigned int to match with the variable type of sg_len
in rz_dmac_prep_slave_sg(). While at it, Remove the braces around
for_each_sg loop as it contains only a single statement.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2->v3:
 * Updated commit description.
v2:
 * New patch.
---
 drivers/dma/sh/rz-dmac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
index 3ef516aee4fc..153893045932 100644
--- a/drivers/dma/sh/rz-dmac.c
+++ b/drivers/dma/sh/rz-dmac.c
@@ -253,7 +253,6 @@ static void rz_dmac_lmdesc_recycle(struct rz_dmac_chan *channel)
 	struct rz_lmdesc *lmdesc = channel->lmdesc.head;
 
 	while (!(lmdesc->header & HEADER_LV)) {
-		lmdesc->header = 0;
 		lmdesc++;
 		if (lmdesc >= (channel->lmdesc.base + DMAC_NR_LMDESC))
 			lmdesc = channel->lmdesc.base;
@@ -510,16 +509,15 @@ rz_dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
 	struct rz_dmac_desc *desc;
 	struct scatterlist *sg;
 	int dma_length = 0;
-	int i = 0;
+	unsigned int i;
 
 	if (list_empty(&channel->ld_free))
 		return NULL;
 
 	desc = list_first_entry(&channel->ld_free, struct rz_dmac_desc, node);
 
-	for_each_sg(sgl, sg, sg_len, i) {
+	for_each_sg(sgl, sg, sg_len, i)
 		dma_length += sg_dma_len(sg);
-	}
 
 	desc->type = RZ_DMAC_DESC_SLAVE_SG;
 	desc->sg = sgl;
-- 
2.25.1


  parent reply	other threads:[~2023-04-12 15:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 15:24 [PATCH v3 0/5] RZ/G2L DMAC enhancements Biju Das
2023-04-12 15:24 ` [PATCH v3 1/5] dmaengine: sh: rz-dmac: Add rz_dmac_invalidate_lmdesc() Biju Das
2023-04-12 15:24 ` [PATCH v3 2/5] dmaengine: sh: rz-dmac: Add device_tx_status() callback Biju Das
2023-04-12 15:24 ` [PATCH v3 3/5] dmaengine: sh: rz-dmac: Add device_{pause,resume}() callbacks Biju Das
2023-04-12 15:24 ` Biju Das [this message]
2023-04-12 15:24 ` [PATCH v3 5/5] dmaengine: sh: rz-dmac: rz_dmac_prepare_descs_for_slave_sg() improvements Biju Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230412152445.117439-5-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.