summary refs log tree commit diff
path: root/drivers/dma/idma64.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-09-14 11:55:38 +0300
committerVinod Koul <vinod.koul@intel.com>2015-09-25 07:54:05 +0530
commit22b74406c5ac1829cd60f75c8c6a4ed1e0f4da03 (patch)
tree3863f6ec5e208e264a77b8f6fe7ad8164570ddd7 /drivers/dma/idma64.c
parent87b045969ad3fe021ccbd1ed88e7cb90adf4ca80 (diff)
downloadlinux-22b74406c5ac1829cd60f75c8c6a4ed1e0f4da03.tar.gz
dmaengine: idma64: useless use of min_t()
We use a pattern

	x = min_t(u32, <LOG2_CONSTANT>, __ffs(expr));

There is no need to use min_t() since we can replace it by

	x = __ffs(expr | <2^LOG2_CONST>);

and moreover guarantee that argument of __ffs() will be not zero.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/idma64.c')
-rw-r--r--drivers/dma/idma64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c
index 13c52b87d59b..e91e499b0d91 100644
--- a/drivers/dma/idma64.c
+++ b/drivers/dma/idma64.c
@@ -257,7 +257,7 @@ static u64 idma64_hw_desc_fill(struct idma64_hw_desc *hw,
 		dar = config->dst_addr;
 		ctllo |= IDMA64C_CTLL_DST_FIX | IDMA64C_CTLL_SRC_INC |
 			 IDMA64C_CTLL_FC_M2P;
-		src_width = min_t(u32, 2, __ffs(sar | hw->len));
+		src_width = __ffs(sar | hw->len | 4);
 		dst_width = __ffs(config->dst_addr_width);
 	} else {	/* DMA_DEV_TO_MEM */
 		sar = config->src_addr;
@@ -265,7 +265,7 @@ static u64 idma64_hw_desc_fill(struct idma64_hw_desc *hw,
 		ctllo |= IDMA64C_CTLL_DST_INC | IDMA64C_CTLL_SRC_FIX |
 			 IDMA64C_CTLL_FC_P2M;
 		src_width = __ffs(config->src_addr_width);
-		dst_width = min_t(u32, 2, __ffs(dar | hw->len));
+		dst_width = __ffs(dar | hw->len | 4);
 	}
 
 	lli->sar = sar;