public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rohit Vaswani <rvaswani@codeaurora.org>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: David Brown <davidb@codeaurora.org>,
	grant.likely@secretlab.ca, linus.walleij@linaro.org,
	yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org
Subject: Re: [weiyj.lk@gmail.com: [PATCH] gpio_msm: using for_each_set_bit to simplify the code]
Date: Mon, 17 Sep 2012 13:24:25 -0700	[thread overview]
Message-ID: <505786F9.6070208@codeaurora.org> (raw)
In-Reply-To: <20120917155006.GA12316@codeaurora.org>

On 9/17/2012 8:50 AM, David Brown wrote:
> ----- Forwarded message from Wei Yongjun <weiyj.lk@gmail.com> -----
>
> Date: Fri, 14 Sep 2012 10:28:31 +0800
> From: Wei Yongjun <weiyj.lk@gmail.com>
> To: grant.likely@secretlab.ca, linus.walleij@linaro.org
> Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org
> Subject: [PATCH] gpio_msm: using for_each_set_bit to simplify the code
>
> 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));
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
> ----- End forwarded message -----
>
Tested-by: Rohit Vaswani <rvaswani@codeaurora.org>

Thanks,
Rohit Vaswani

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


           reply	other threads:[~2012-09-17 20:24 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20120917155006.GA12316@codeaurora.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505786F9.6070208@codeaurora.org \
    --to=rvaswani@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weiyj.lk@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox