[PATCH] omap-dma: simplify omap_dma_busy()

Yury Norov posted 1 patch 2 months, 2 weeks ago
drivers/dma/ti/omap-dma.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
[PATCH] omap-dma: simplify omap_dma_busy()
Posted by Yury Norov 2 months, 2 weeks ago
From: Yury Norov (NVIDIA) <yury.norov@gmail.com>

Use for_each_set_bit() and get rid of housekeeping code.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
---
 drivers/dma/ti/omap-dma.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c
index 8c023c6e623a..ac5c1f32c856 100644
--- a/drivers/dma/ti/omap-dma.c
+++ b/drivers/dma/ti/omap-dma.c
@@ -1530,12 +1530,9 @@ static void omap_dma_free(struct omap_dmadev *od)
 static bool omap_dma_busy(struct omap_dmadev *od)
 {
 	struct omap_chan *c;
-	int lch = -1;
+	int lch;
 
-	while (1) {
-		lch = find_next_bit(od->lch_bitmap, od->lch_count, lch + 1);
-		if (lch >= od->lch_count)
-			break;
+	for_each_set_bit(lch, od->lch_bitmap, od->lch_count) {
 		c = od->lch_map[lch];
 		if (!c)
 			continue;
-- 
2.43.0