All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
@ 2013-03-11 14:23 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2013-03-11 14:23 UTC (permalink / raw)
  To: baohua.song, linus.walleij, grant.likely, rob.herring
  Cc: yongjun_wei, linux-arm-kernel, devicetree-discuss, linux-kernel

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

Using for_each_set_bit() to simplify the code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/pinctrl/pinctrl-sirf.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index 498b2ba..d6cf500 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -1669,15 +1669,12 @@ static void sirfsoc_gpio_set_pullup(const u32 *pullups)
 	const unsigned long *p = (const unsigned long *)pullups;
 
 	for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
-		n = find_first_bit(p + i, BITS_PER_LONG);
-		while (n < BITS_PER_LONG) {
+		for_each_set_bit(n, p + i, BITS_PER_LONG) {
 			u32 offset = SIRFSOC_GPIO_CTRL(i, n);
 			u32 val = readl(sgpio_bank[i].chip.regs + offset);
 			val |= SIRFSOC_GPIO_CTL_PULL_MASK;
 			val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
 			writel(val, sgpio_bank[i].chip.regs + offset);
-
-			n = find_next_bit(p + i, BITS_PER_LONG, n + 1);
 		}
 	}
 }
@@ -1688,15 +1685,12 @@ static void sirfsoc_gpio_set_pulldown(const u32 *pulldowns)
 	const unsigned long *p = (const unsigned long *)pulldowns;
 
 	for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
-		n = find_first_bit(p + i, BITS_PER_LONG);
-		while (n < BITS_PER_LONG) {
+		for_each_set_bit(n, p + i, BITS_PER_LONG) {
 			u32 offset = SIRFSOC_GPIO_CTRL(i, n);
 			u32 val = readl(sgpio_bank[i].chip.regs + offset);
 			val |= SIRFSOC_GPIO_CTL_PULL_MASK;
 			val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
 			writel(val, sgpio_bank[i].chip.regs + offset);
-
-			n = find_next_bit(p + i, BITS_PER_LONG, n + 1);
 		}
 	}
 }


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

* [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
@ 2013-03-11 14:23 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2013-03-11 14:23 UTC (permalink / raw)
  To: linux-arm-kernel

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

Using for_each_set_bit() to simplify the code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/pinctrl/pinctrl-sirf.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
index 498b2ba..d6cf500 100644
--- a/drivers/pinctrl/pinctrl-sirf.c
+++ b/drivers/pinctrl/pinctrl-sirf.c
@@ -1669,15 +1669,12 @@ static void sirfsoc_gpio_set_pullup(const u32 *pullups)
 	const unsigned long *p = (const unsigned long *)pullups;
 
 	for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
-		n = find_first_bit(p + i, BITS_PER_LONG);
-		while (n < BITS_PER_LONG) {
+		for_each_set_bit(n, p + i, BITS_PER_LONG) {
 			u32 offset = SIRFSOC_GPIO_CTRL(i, n);
 			u32 val = readl(sgpio_bank[i].chip.regs + offset);
 			val |= SIRFSOC_GPIO_CTL_PULL_MASK;
 			val |= SIRFSOC_GPIO_CTL_PULL_HIGH;
 			writel(val, sgpio_bank[i].chip.regs + offset);
-
-			n = find_next_bit(p + i, BITS_PER_LONG, n + 1);
 		}
 	}
 }
@@ -1688,15 +1685,12 @@ static void sirfsoc_gpio_set_pulldown(const u32 *pulldowns)
 	const unsigned long *p = (const unsigned long *)pulldowns;
 
 	for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
-		n = find_first_bit(p + i, BITS_PER_LONG);
-		while (n < BITS_PER_LONG) {
+		for_each_set_bit(n, p + i, BITS_PER_LONG) {
 			u32 offset = SIRFSOC_GPIO_CTRL(i, n);
 			u32 val = readl(sgpio_bank[i].chip.regs + offset);
 			val |= SIRFSOC_GPIO_CTL_PULL_MASK;
 			val &= ~SIRFSOC_GPIO_CTL_PULL_HIGH;
 			writel(val, sgpio_bank[i].chip.regs + offset);
-
-			n = find_next_bit(p + i, BITS_PER_LONG, n + 1);
 		}
 	}
 }

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

* Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
  2013-03-11 14:23 ` Wei Yongjun
@ 2013-03-13 17:50   ` Linus Walleij
  -1 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2013-03-13 17:50 UTC (permalink / raw)
  To: Wei Yongjun, Barry Song
  Cc: grant.likely, rob.herring, yongjun_wei, linux-arm-kernel,
	devicetree-discuss, linux-kernel

On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using for_each_set_bit() to simplify the code.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Barry, can I have your ACK on this?

Yours,
Linus Walleij

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

* [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
@ 2013-03-13 17:50   ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2013-03-13 17:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using for_each_set_bit() to simplify the code.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Barry, can I have your ACK on this?

Yours,
Linus Walleij

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

* Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
  2013-03-13 17:50   ` Linus Walleij
@ 2013-03-18  2:34     ` Barry Song
  -1 siblings, 0 replies; 8+ messages in thread
From: Barry Song @ 2013-03-18  2:34 UTC (permalink / raw)
  To: Linus Walleij, Wei Yongjun
  Cc: devicetree-discuss, linux-kernel, rob.herring, yongjun_wei,
	linux-arm-kernel, DL-SHA-WorkGroupLinux

2013/3/14 Linus Walleij <linus.walleij@linaro.org>
>
> On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
>
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> >
> > Using for_each_set_bit() to simplify the code.
> >
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Barry, can I have your ACK on this?

yes. acked. thanks Yongjun, Linus.

>
> Yours,
> Linus Walleij

-barry

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

* [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
@ 2013-03-18  2:34     ` Barry Song
  0 siblings, 0 replies; 8+ messages in thread
From: Barry Song @ 2013-03-18  2:34 UTC (permalink / raw)
  To: linux-arm-kernel

2013/3/14 Linus Walleij <linus.walleij@linaro.org>
>
> On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
>
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> >
> > Using for_each_set_bit() to simplify the code.
> >
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Barry, can I have your ACK on this?

yes. acked. thanks Yongjun, Linus.

>
> Yours,
> Linus Walleij

-barry

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

* Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
  2013-03-11 14:23 ` Wei Yongjun
@ 2013-03-27 21:54   ` Linus Walleij
  -1 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2013-03-27 21:54 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: baohua.song, grant.likely, rob.herring, yongjun_wei,
	linux-arm-kernel, devicetree-discuss, linux-kernel

On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using for_each_set_bit() to simplify the code.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied with Barry's ACK.

Thanks!
Linus Walleij

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

* [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code
@ 2013-03-27 21:54   ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2013-03-27 21:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using for_each_set_bit() to simplify the code.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied with Barry's ACK.

Thanks!
Linus Walleij

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

end of thread, other threads:[~2013-03-27 21:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-11 14:23 [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code Wei Yongjun
2013-03-11 14:23 ` Wei Yongjun
2013-03-13 17:50 ` Linus Walleij
2013-03-13 17:50   ` Linus Walleij
2013-03-18  2:34   ` Barry Song
2013-03-18  2:34     ` Barry Song
2013-03-27 21:54 ` Linus Walleij
2013-03-27 21:54   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.