[PATCH v4 03/13] dmaengine: axi-dmac: use sg_nents_for_dma() helper
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Mon Nov 24 04:09:21 PST 2025
Instead of open coded variant let's use recently introduced helper.
Reviewed-by: Bjorn Andersson <andersson at kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
---
drivers/dma/dma-axi-dmac.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index 5b06b0dc67ee..5d4436e7d2ee 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -674,10 +674,7 @@ static struct dma_async_tx_descriptor *axi_dmac_prep_slave_sg(
if (direction != chan->direction)
return NULL;
- num_sgs = 0;
- for_each_sg(sgl, sg, sg_len, i)
- num_sgs += DIV_ROUND_UP(sg_dma_len(sg), chan->max_length);
-
+ num_sgs = sg_nents_for_dma(sgl, sg_len, chan->max_length);
desc = axi_dmac_alloc_desc(chan, num_sgs);
if (!desc)
return NULL;
--
2.50.1
More information about the linux-arm-kernel
mailing list