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


Groups > linux.kernel > #1447104

[PATCH v2 2/6] dmaengine: omap-dma: Simplify omap_dma_callback

From Peter Ujfalusi <peter.ujfalusi@ti.com>
Newsgroups linux.kernel
Subject [PATCH v2 2/6] dmaengine: omap-dma: Simplify omap_dma_callback
Date 2016-07-20 11:00 +0200
Message-ID <rWVwd-7zq-9@gated-at.bofh.it> (permalink)
References <rWVwd-7zq-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Flatten the indentation level of the function which gives better view on
the cases we handle here.

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

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 7d56cd88c9a5..d469f9b820e0 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -445,15 +445,13 @@ static void omap_dma_callback(int ch, u16 status, void *data)
 	spin_lock_irqsave(&c->vc.lock, flags);
 	d = c->desc;
 	if (d) {
-		if (!c->cyclic) {
-			if (c->sgidx < d->sglen) {
-				omap_dma_start_sg(c, d);
-			} else {
-				omap_dma_start_desc(c);
-				vchan_cookie_complete(&d->vd);
-			}
-		} else {
+		if (c->cyclic) {
 			vchan_cyclic_callback(&d->vd);
+		} else if (c->sgidx == d->sglen) {
+			omap_dma_start_desc(c);
+			vchan_cookie_complete(&d->vd);
+		} else {
+			omap_dma_start_sg(c, d);
 		}
 	}
 	spin_unlock_irqrestore(&c->vc.lock, flags);
-- 
2.9.2

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


Thread

[PATCH v2 2/6] dmaengine: omap-dma: Simplify omap_dma_callback Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-07-20 11:00 +0200

csiph-web