Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1447111

[PATCH v2 5/6] dmaengine: omap-dma: Use pointer to omap_sg in slave_sg setup's loop

From Peter Ujfalusi <peter.ujfalusi@ti.com>
Newsgroups linux.kernel
Subject [PATCH v2 5/6] dmaengine: omap-dma: Use pointer to omap_sg in slave_sg setup's loop
Date 2016-07-20 11:00 +0200
Message-ID <rWVwe-7zq-25@gated-at.bofh.it> (permalink)
References <rWVwd-7zq-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Instead of accessing the array via index, take the pointer first and use
it to set up the omap_sg struct.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/dma/omap-dma.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 072fff7164dd..9f1cfac16f92 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -819,9 +819,11 @@ 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[i].addr = sg_dma_address(sgent);
-		d->sg[i].en = en;
-		d->sg[i].fn = sg_dma_len(sgent) / frame_bytes;
+		struct omap_sg *osg = &d->sg[i];
+
+		osg->addr = sg_dma_address(sgent);
+		osg->en = en;
+		osg->fn = sg_dma_len(sgent) / frame_bytes;
 	}
 
 	d->sglen = sglen;
-- 
2.9.2

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] dmaengine:omap-dma: Linked List transfer for slave_sg Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-07-20 11:00 +0200
  [PATCH v2 6/6] dmaengine: omap-dma: Support for LinkedList transfer of slave_sg Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-07-20 11:00 +0200
  [PATCH v2 5/6] dmaengine: omap-dma: Use pointer to omap_sg in slave_sg setup's loop Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-07-20 11:00 +0200
  [PATCH v2 1/6] dmaengine: omap-dma: Simplify omap_dma_start_sg parameter list Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-07-20 11:00 +0200

csiph-web