Re: [PATCH 34/39] dmaengine: ste_dma40: Convert data_width fromregister bit format to value

From: Vinod Koul
Date: Thu May 16 2013 - 06:17:31 EST


On Thu, May 16, 2013 at 08:35:53AM +0100, Lee Jones wrote:
> On Thu, 16 May 2013, Vinod Koul wrote:
>
> > On Wed, May 15, 2013 at 10:51:57AM +0100, Lee Jones wrote:
> > > +u8 d40_width_to_bits(enum dma_slave_buswidth width)
> > > +{
> > > + if (width == DMA_SLAVE_BUSWIDTH_1_BYTE)
> > > + return STEDMA40_ESIZE_8_BIT;
> > > + else if (width == DMA_SLAVE_BUSWIDTH_2_BYTES)
> > > + return STEDMA40_ESIZE_16_BIT;
> > > + else if (width == DMA_SLAVE_BUSWIDTH_8_BYTES)
> > > + return STEDMA40_ESIZE_64_BIT;
> > > + else
> > > + return STEDMA40_ESIZE_32_BIT;
> > > +}
> > > +
> > Switch looks better for this and how about
> > return fls(width);
> >
> > as your defines are 0...3 and dmaengine define 1,2,..8 for same thing
> > then you can also get rid of STEDMA40_XXX_WIDTH macros!
>
> I like it.
>
> Will you let me do it as a follow-up patch?
Okay...

--
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/