* [PATCH] ste_dma40: simplify d40_handle_interrupt()
@ 2025-07-20 2:21 Yury Norov
2025-07-23 11:41 ` Linus Walleij
2025-07-23 12:12 ` Vinod Koul
0 siblings, 2 replies; 4+ messages in thread
From: Yury Norov @ 2025-07-20 2:21 UTC (permalink / raw)
To: Linus Walleij, Vinod Koul, linux-arm-kernel, dmaengine,
linux-kernel
Cc: Yury Norov
From: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Use for_each_set_bit() iterator and drop housekeeping code.
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ste_dma40: simplify d40_handle_interrupt()
2025-07-20 2:21 [PATCH] ste_dma40: simplify d40_handle_interrupt() Yury Norov
@ 2025-07-23 11:41 ` Linus Walleij
2025-07-23 12:12 ` Vinod Koul
1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2025-07-23 11:41 UTC (permalink / raw)
To: Yury Norov; +Cc: Vinod Koul, linux-arm-kernel, dmaengine, linux-kernel
On Sun, Jul 20, 2025 at 4:21 AM Yury Norov <yury.norov@gmail.com> wrote:
> From: Yury Norov (NVIDIA) <yury.norov@gmail.com>
>
> Use for_each_set_bit() iterator and drop housekeeping code.
>
> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Neat, looks correct!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ste_dma40: simplify d40_handle_interrupt()
2025-07-20 2:21 [PATCH] ste_dma40: simplify d40_handle_interrupt() Yury Norov
2025-07-23 11:41 ` Linus Walleij
@ 2025-07-23 12:12 ` Vinod Koul
2025-07-25 15:35 ` Yury Norov
1 sibling, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2025-07-23 12:12 UTC (permalink / raw)
To: Yury Norov; +Cc: Linus Walleij, linux-arm-kernel, dmaengine, linux-kernel
On 19-07-25, 22:21, Yury Norov wrote:
> From: Yury Norov (NVIDIA) <yury.norov@gmail.com>
What is the meaning of NVIDIA in your name?
Pls add the subsystem name to the patch as well (this and others you
sent)
>
> Use for_each_set_bit() iterator and drop housekeeping code.
>
> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.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
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ste_dma40: simplify d40_handle_interrupt()
2025-07-23 12:12 ` Vinod Koul
@ 2025-07-25 15:35 ` Yury Norov
0 siblings, 0 replies; 4+ messages in thread
From: Yury Norov @ 2025-07-25 15:35 UTC (permalink / raw)
To: Vinod Koul; +Cc: Linus Walleij, linux-arm-kernel, dmaengine, linux-kernel
On Wed, Jul 23, 2025 at 05:42:21PM +0530, Vinod Koul wrote:
> On 19-07-25, 22:21, Yury Norov wrote:
> > From: Yury Norov (NVIDIA) <yury.norov@gmail.com>
>
> What is the meaning of NVIDIA in your name?
My employer.
> Pls add the subsystem name to the patch as well (this and others you
> sent)
OK
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-25 15:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-20 2:21 [PATCH] ste_dma40: simplify d40_handle_interrupt() Yury Norov
2025-07-23 11:41 ` Linus Walleij
2025-07-23 12:12 ` Vinod Koul
2025-07-25 15:35 ` Yury Norov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).