Commit 425f871d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul
Browse files

dmaengine: qcom: adm: use sg_nents_for_dma() helper



Instead of open coded variant let's use recently introduced helper.

Reviewed-by: default avatarBjorn Andersson <andersson@kernel.org>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260108105619.3513561-10-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 068942ea
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -390,16 +390,15 @@ static struct dma_async_tx_descriptor *adm_prep_slave_sg(struct dma_chan *chan,
	}

	/* iterate through sgs and compute allocation size of structures */
	for_each_sg(sgl, sg, sg_len, i) {
	if (achan->slave.device_fc) {
		for_each_sg(sgl, sg, sg_len, i) {
			box_count += DIV_ROUND_UP(sg_dma_len(sg) / burst,
						  ADM_MAX_ROWS);
			if (sg_dma_len(sg) % burst)
				single_count++;
		} else {
			single_count += DIV_ROUND_UP(sg_dma_len(sg),
						     ADM_MAX_XFER);
		}
	} else {
		single_count = sg_nents_for_dma(sgl, sg_len, ADM_MAX_XFER);
	}

	async_desc = kzalloc(sizeof(*async_desc), GFP_NOWAIT);