From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: vinod.koul@intel.com, linux@arm.linux.org.uk
Cc: tony@atomide.com, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org, dmaengine@vger.kernel.org
Subject: [PATCH 2/4] dmaengine: omap-dma: Clean up the prep_slave_sg sg list walk code
Date: Wed, 11 Nov 2015 12:37:56 +0200 [thread overview]
Message-ID: <1447238278-15863-3-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1447238278-15863-1-git-send-email-peter.ujfalusi@ti.com>
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: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/dma/omap-dma.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 8ed39ce24d46..4afc2c18d451 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -768,7 +768,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
struct scatterlist *sgent;
struct omap_desc *d;
dma_addr_t dev_addr;
- unsigned i, j = 0, es, en, frame_bytes;
+ unsigned i, es, en, frame_bytes;
u32 burst;
if (dir == DMA_DEV_TO_MEM) {
@@ -845,13 +845,12 @@ static struct dma_async_tx_descriptor *omap_dma_prep_slave_sg(
en = burst;
frame_bytes = es_bytes[es] * en;
for_each_sg(sgl, sgent, sglen, i) {
- d->sg[j].addr = sg_dma_address(sgent);
- d->sg[j].en = en;
- d->sg[j].fn = sg_dma_len(sgent) / frame_bytes;
- j++;
+ d->sg[i].addr = sg_dma_address(sgent);
+ d->sg[i].en = en;
+ d->sg[i].fn = sg_dma_len(sgent) / frame_bytes;
}
- d->sglen = j;
+ d->sglen = sglen;
return vchan_tx_prep(&c->vc, &d->vd, tx_flags);
}
--
2.6.2
next prev parent reply other threads:[~2015-11-11 10:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-11 10:37 [PATCH 0/4] dmaengine: omap-dma: transfer start and short memcpy improvement Peter Ujfalusi
2015-11-11 10:37 ` [PATCH 1/4] dmaengine: omap-dma: Correct status reporting for memcpy Peter Ujfalusi
2015-11-11 10:37 ` Peter Ujfalusi [this message]
2015-11-11 10:37 ` [PATCH 3/4] dmaengine: omap-dma: Remove tasklet to start the transfers Peter Ujfalusi
2015-11-11 10:37 ` [PATCH 4/4] dmaengine: omap-dma: Handle cases when the channel is polled for completion Peter Ujfalusi
2015-12-05 8:07 ` [PATCH 0/4] dmaengine: omap-dma: transfer start and short memcpy improvement Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1447238278-15863-3-git-send-email-peter.ujfalusi@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=tony@atomide.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox