* [PATCH] dma: ste_dma40: use for_each_set_bit
@ 2012-10-27 15:49 Akinobu Mita
2012-10-28 19:06 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2012-10-27 15:49 UTC (permalink / raw)
To: linux-arm-kernel
Replace open-coded loop with for_each_set_bit().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel at lists.infradead.org
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>
---
drivers/dma/ste_dma40.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index ae55091..08f5bfe 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1487,7 +1487,7 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
u32 regs[ARRAY_SIZE(il)];
u32 idx;
u32 row;
- long chan = -1;
+ long chan;
struct d40_chan *d40c;
unsigned long flags;
struct d40_base *base = data;
@@ -1498,15 +1498,8 @@ static irqreturn_t d40_handle_interrupt(int irq, void *data)
for (i = 0; i < ARRAY_SIZE(il); i++)
regs[i] = readl(base->virtbase + il[i].src);
- for (;;) {
-
- chan = find_next_bit((unsigned long *)regs,
- BITS_PER_LONG * ARRAY_SIZE(il), chan + 1);
-
- /* No more set bits found? */
- if (chan == BITS_PER_LONG * ARRAY_SIZE(il))
- break;
-
+ for_each_set_bit(chan, (unsigned long *)regs,
+ BITS_PER_LONG * ARRAY_SIZE(il)) {
row = chan / BITS_PER_LONG;
idx = chan & (BITS_PER_LONG - 1);
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] dma: ste_dma40: use for_each_set_bit
2012-10-27 15:49 [PATCH] dma: ste_dma40: use for_each_set_bit Akinobu Mita
@ 2012-10-28 19:06 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2012-10-28 19:06 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 27, 2012 at 5:49 PM, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> Replace open-coded loop with for_each_set_bit().
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Dan Williams <djbw@fb.com>
Makes perfect sense to me,
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-28 19:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-27 15:49 [PATCH] dma: ste_dma40: use for_each_set_bit Akinobu Mita
2012-10-28 19:06 ` Linus Walleij
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).