linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio_msm: using for_each_set_bit to simplify the code
@ 2012-09-14  2:28 Wei Yongjun
  2012-09-17 10:54 ` Linus Walleij
  2012-09-18 21:17 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Yongjun @ 2012-09-14  2:28 UTC (permalink / raw)
  To: grant.likely, linus.walleij; +Cc: yongjun_wei, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Using for_each_set_bit() to simplify the code.

spatch with a semantic match is used to found this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpio/gpio-msm-v2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c
index 5cb1227..38305be 100644
--- a/drivers/gpio/gpio-msm-v2.c
+++ b/drivers/gpio/gpio-msm-v2.c
@@ -317,9 +317,7 @@ static void msm_summary_irq_handler(unsigned int irq, struct irq_desc *desc)
 
 	chained_irq_enter(chip, desc);
 
-	for (i = find_first_bit(msm_gpio.enabled_irqs, NR_GPIO_IRQS);
-	     i < NR_GPIO_IRQS;
-	     i = find_next_bit(msm_gpio.enabled_irqs, NR_GPIO_IRQS, i + 1)) {
+	for_each_set_bit(i, msm_gpio.enabled_irqs, NR_GPIO_IRQS) {
 		if (readl(GPIO_INTR_STATUS(i)) & BIT(INTR_STATUS))
 			generic_handle_irq(msm_gpio_to_irq(&msm_gpio.gpio_chip,
 							   i));



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio_msm: using for_each_set_bit to simplify the code
  2012-09-14  2:28 [PATCH] gpio_msm: using for_each_set_bit to simplify the code Wei Yongjun
@ 2012-09-17 10:54 ` Linus Walleij
  2012-09-17 15:51   ` David Brown
  2012-09-18 21:17 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2012-09-17 10:54 UTC (permalink / raw)
  To: Wei Yongjun, David Brown; +Cc: grant.likely, yongjun_wei, linux-kernel

On Fri, Sep 14, 2012 at 4:28 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using for_each_set_bit() to simplify the code.
>
> spatch with a semantic match is used to found this.
> (http://coccinelle.lip6.fr/)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

David, does this patch look OK from your point of view?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio_msm: using for_each_set_bit to simplify the code
  2012-09-17 10:54 ` Linus Walleij
@ 2012-09-17 15:51   ` David Brown
  0 siblings, 0 replies; 4+ messages in thread
From: David Brown @ 2012-09-17 15:51 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Wei Yongjun, grant.likely, yongjun_wei, linux-kernel

On Mon, Sep 17, 2012 at 12:54:45PM +0200, Linus Walleij wrote:
> On Fri, Sep 14, 2012 at 4:28 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> 
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> >
> > Using for_each_set_bit() to simplify the code.
> >
> > spatch with a semantic match is used to found this.
> > (http://coccinelle.lip6.fr/)
> >
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> David, does this patch look OK from your point of view?

It appears to.  Rohit Vaswani is doing some work on this driver, so
I've also forwarded the patch to him.

Acked-by: David Brown <davidb@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpio_msm: using for_each_set_bit to simplify the code
  2012-09-14  2:28 [PATCH] gpio_msm: using for_each_set_bit to simplify the code Wei Yongjun
  2012-09-17 10:54 ` Linus Walleij
@ 2012-09-18 21:17 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-09-18 21:17 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: grant.likely, yongjun_wei, linux-kernel

On Fri, Sep 14, 2012 at 4:28 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using for_each_set_bit() to simplify the code.
>
> spatch with a semantic match is used to found this.
> (http://coccinelle.lip6.fr/)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied with David's ACK, thanks!
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-18 21:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-14  2:28 [PATCH] gpio_msm: using for_each_set_bit to simplify the code Wei Yongjun
2012-09-17 10:54 ` Linus Walleij
2012-09-17 15:51   ` David Brown
2012-09-18 21:17 ` 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).