Commit e8a5e79c authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Vinod Koul

dmaengine: omap-dma: Clean up the prep_slave_sg sg list walk code

The for_each_sg() macro's last parameter is inteded to be used as counter.
We can use 'i' instead of 'j' within the loop for indexes.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent adf850bc
...@@ -768,7 +768,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( ...@@ -768,7 +768,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
struct scatterlist *sgent; struct scatterlist *sgent;
struct omap_desc *d; struct omap_desc *d;
dma_addr_t dev_addr; dma_addr_t dev_addr;
unsigned i, j = 0, es, en, frame_bytes; unsigned i, es, en, frame_bytes;
u32 burst; u32 burst;
if (dir == DMA_DEV_TO_MEM) { if (dir == DMA_DEV_TO_MEM) {
...@@ -845,13 +845,12 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg( ...@@ -845,13 +845,12 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
en = burst; en = burst;
frame_bytes = es_bytes[es] * en; frame_bytes = es_bytes[es] * en;
for_each_sg(sgl, sgent, sglen, i) { for_each_sg(sgl, sgent, sglen, i) {
d->sg[j].addr = sg_dma_address(sgent); d->sg[i].addr = sg_dma_address(sgent);
d->sg[j].en = en; d->sg[i].en = en;
d->sg[j].fn = sg_dma_len(sgent) / frame_bytes; d->sg[i].fn = sg_dma_len(sgent) / frame_bytes;
j++;
} }
d->sglen = j; d->sglen = sglen;
return vchan_tx_prep(&c->vc, &d->vd, tx_flags); return vchan_tx_prep(&c->vc, &d->vd, tx_flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment