lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250720022129.437094-1-yury.norov@gmail.com>
Date: Sat, 19 Jul 2025 22:21:28 -0400
From: Yury Norov <yury.norov@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>,
	Vinod Koul <vkoul@...nel.org>,
	linux-arm-kernel@...ts.infradead.org,
	dmaengine@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>
Subject: [PATCH] ste_dma40: simplify d40_handle_interrupt()

From: Yury Norov (NVIDIA) <yury.norov@...il.com>

Use for_each_set_bit() iterator and drop housekeeping code.

Signed-off-by: Yury Norov (NVIDIA) <yury.norov@...il.com>
---
 drivers/dma/ste_dma40.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index d52e1685aed5..6cc76f935c7c 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1664,7 +1664,7 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
 	int i;
 	u32 idx;
 	u32 row;
-	long chan = -1;
+	long chan;
 	struct d40_chan *d40c;
 	struct d40_base *base = data;
 	u32 *regs = base->regs_interrupt;
@@ -1677,15 +1677,7 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
 	for (i = 0; i < il_size; i++)
 		regs[i] = readl(base->virtbase + il[i].src);
 
-	for (;;) {
-
-		chan = find_next_bit((unsigned long *)regs,
-				     BITS_PER_LONG * il_size, chan + 1);
-
-		/* No more set bits found? */
-		if (chan == BITS_PER_LONG * il_size)
-			break;
-
+	for_each_set_bit(chan, (unsigned long *)regs, BITS_PER_LONG * il_size) {
 		row = chan / BITS_PER_LONG;
 		idx = chan & (BITS_PER_LONG - 1);
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ