Thread (126 messages) flat view 126 messages, 6 authors, 2013-06-11

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

From: Vinod Koul <hidden>
Date: 2013-05-16 10:17:27
Also in: linux-crypto, lkml

On Thu, May 16, 2013 at 08:35:53AM +0100, Lee Jones wrote:
On Thu, 16 May 2013, Vinod Koul wrote:
quoted
On Wed, May 15, 2013 at 10:51:57AM +0100, Lee Jones wrote:
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help