lkml.org 
[lkml]   [2021]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] dmaengine: rcar-dmac: Add for_each_rcar_dmac_chan() helper
On 12-01-21, 11:26, Geert Uytterhoeven wrote:
> Hi Vinod,
>
> On Tue, Jan 12, 2021 at 11:19 AM Vinod Koul <vkoul@kernel.org> wrote:
> > On 07-01-21, 19:15, Geert Uytterhoeven wrote:
> > > Add and helper macro for iterating over all DMAC channels, taking into
> > > account the channel mask. Use it where appropriate, to simplify code.
> > >
> > > Restore "reverse Christmas tree" order of local variables while adding a
> > > new variable.
> > >
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> > > --- a/drivers/dma/sh/rcar-dmac.c
> > > +++ b/drivers/dma/sh/rcar-dmac.c
> > > @@ -209,6 +209,11 @@ struct rcar_dmac {
> > >
> > > #define to_rcar_dmac(d) container_of(d, struct rcar_dmac, engine)
> > >
> > > +#define for_each_rcar_dmac_chan(i, chan, dmac) \
> > > + for (i = 0, chan = &(dmac)->channels[0]; i < (dmac)->n_channels; \
> > > + i++, chan++) \
> >
> > single line to make it more readable? we have limit of 100 now :)
>
> Do we have to push the limits?

In cases where it helps, I certainly recommend.. I feel in this case it
makes a better read to have it in a single line..

> BTW, the new punched cards are 96-column wide, not 100-column ;-)
> https://en.wikipedia.org/wiki/Punched_card#IBM_96-column_format

Did we err in choosing 100 :D

--
~Vinod

\
 
 \ /
  Last update: 2021-01-12 11:40    [W:0.038 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site