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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux