[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3da88ffe37e1fa20918848fdef8f80e5ae49743a.camel@crapouillou.net>
Date: Mon, 11 Dec 2023 13:15:38 +0100
From: Paul Cercueil <paul@...pouillou.net>
To: Vinod Koul <vkoul@...nel.org>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Nuno Sá <noname.nuno@...il.com>,
Michael Hennerich <Michael.Hennerich@...log.com>,
dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] dmaengine: axi-dmac: Small code cleanup
Hi Vinod,
Le lundi 11 décembre 2023 à 17:27 +0530, Vinod Koul a écrit :
> On 04-12-23, 15:03, Paul Cercueil wrote:
> > Use a for() loop instead of a while() loop in
> > axi_dmac_fill_linear_sg().
>
> Why?
Simplicity? Code quality?
-Paul
>
> >
> > Signed-off-by: Paul Cercueil <paul@...pouillou.net>
> > ---
> > drivers/dma/dma-axi-dmac.c | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-
> > dmac.c
> > index 2457a420c13d..760940b21eab 100644
> > --- a/drivers/dma/dma-axi-dmac.c
> > +++ b/drivers/dma/dma-axi-dmac.c
> > @@ -508,16 +508,13 @@ static struct axi_dmac_sg
> > *axi_dmac_fill_linear_sg(struct axi_dmac_chan *chan,
> > segment_size = ((segment_size - 1) | chan-
> > >length_align_mask) + 1;
> >
> > for (i = 0; i < num_periods; i++) {
> > - len = period_len;
> > -
> > - while (len > segment_size) {
> > + for (len = period_len; len > segment_size; sg++) {
> > if (direction == DMA_DEV_TO_MEM)
> > sg->dest_addr = addr;
> > else
> > sg->src_addr = addr;
> > sg->x_len = segment_size;
> > sg->y_len = 1;
> > - sg++;
> > addr += segment_size;
> > len -= segment_size;
> > }
> > --
> > 2.42.0
> >
>
Powered by blists - more mailing lists