diff mbox series

[v3,4/5] dmaengine: sh: rz-dmac: Trivial code clean-ups

Message ID 20230412152445.117439-5-biju.das.jz@bp.renesas.com (mailing list archive)
State Under Review
Delegated to: Geert Uytterhoeven
Headers show
Series RZ/G2L DMAC enhancements | expand

Commit Message

Biju Das April 12, 2023, 3:24 p.m. UTC
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 mbox series

Patch

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;