提交 92e4a3bf 编写于 作者: M Maxime Ripard 提交者: Vinod Koul

dmaengine: sun6i: Remove switch statement from buswidth convertion routine

Since the conversion routine is quite trivial, we don't need this switch, and
we can just use a simple calculation.
Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 2795eedf
......@@ -248,20 +248,11 @@ static inline int convert_burst(u32 maxburst, u8 *burst)
static inline int convert_buswidth(enum dma_slave_buswidth addr_width, u8 *width)
{
switch (addr_width) {
case DMA_SLAVE_BUSWIDTH_1_BYTE:
*width = 0;
break;
case DMA_SLAVE_BUSWIDTH_2_BYTES:
*width = 1;
break;
case DMA_SLAVE_BUSWIDTH_4_BYTES:
*width = 2;
break;
default:
if ((addr_width < DMA_SLAVE_BUSWIDTH_1_BYTE) ||
(addr_width > DMA_SLAVE_BUSWIDTH_4_BYTES))
return -EINVAL;
}
*width = addr_width >> 1;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册