Skip to content

Commit 024ae9d

Browse files
andy-shevvinodkoul
authored andcommitted
dmaengine: axi-dmac: use sg_nents_for_dma() helper
Instead of open coded variant let's use recently introduced helper. Reviewed-by: Bjorn Andersson <andersson@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20260108105619.3513561-4-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 47f5cb7 commit 024ae9d

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/dma/dma-axi-dmac.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,10 +677,7 @@ static struct dma_async_tx_descriptor *axi_dmac_prep_slave_sg(
677677
if (direction != chan->direction)
678678
return NULL;
679679

680-
num_sgs = 0;
681-
for_each_sg(sgl, sg, sg_len, i)
682-
num_sgs += DIV_ROUND_UP(sg_dma_len(sg), chan->max_length);
683-
680+
num_sgs = sg_nents_for_dma(sgl, sg_len, chan->max_length);
684681
desc = axi_dmac_alloc_desc(chan, num_sgs);
685682
if (!desc)
686683
return NULL;

0 commit comments

Comments
 (0)