Skip to contentSkip to conversation

gpio_msm: using for_each_set_bit to simplify the code]

PATCH Rohit Vaswani 1 participant 1 message Sep 17, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Rohit Vaswani

author Tested-by
#1 lore raw
Quoted 43 lines · David Brown

----- Forwarded message from Wei Yongjun <[email protected]> -----

Date: Fri, 14 Sep 2012 10:28:31 +0800
From: Wei Yongjun <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], [email protected]
Subject: [PATCH] gpio_msm: using for_each_set_bit to simplify the code

From: Wei Yongjun <[email protected]>

Using for_each_set_bit() to simplify the code.

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

---
  drivers/gpio/gpio-msm-v2.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpio/gpio-msm-v2.c +1 -4
index 5cb1227..38305be 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Quoted 2 lines

----- End forwarded message -----

Thanks,
Rohit Vaswani

Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation