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@xxxxxxxxxxxxxx> --- 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