Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-27 Thread Linus Walleij
On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun  wrote:

> From: Wei Yongjun 
>
> Using for_each_set_bit() to simplify the code.
>
> Signed-off-by: Wei Yongjun 

Applied with Barry's ACK.

Thanks!
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-27 Thread Linus Walleij
On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun weiyj...@gmail.com wrote:

 From: Wei Yongjun yongjun_...@trendmicro.com.cn

 Using for_each_set_bit() to simplify the code.

 Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn

Applied with Barry's ACK.

Thanks!
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-17 Thread Barry Song
2013/3/14 Linus Walleij 
>
> On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun  wrote:
>
> > From: Wei Yongjun 
> >
> > Using for_each_set_bit() to simplify the code.
> >
> > Signed-off-by: Wei Yongjun 
>
> Barry, can I have your ACK on this?

yes. acked. thanks Yongjun, Linus.

>
> Yours,
> Linus Walleij

-barry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-17 Thread Barry Song
2013/3/14 Linus Walleij linus.wall...@linaro.org

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

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

 Barry, can I have your ACK on this?

yes. acked. thanks Yongjun, Linus.


 Yours,
 Linus Walleij

-barry
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-13 Thread Linus Walleij
On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun  wrote:

> From: Wei Yongjun 
>
> Using for_each_set_bit() to simplify the code.
>
> Signed-off-by: Wei Yongjun 

Barry, can I have your ACK on this?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-13 Thread Linus Walleij
On Mon, Mar 11, 2013 at 3:23 PM, Wei Yongjun weiyj...@gmail.com wrote:

 From: Wei Yongjun yongjun_...@trendmicro.com.cn

 Using for_each_set_bit() to simplify the code.

 Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn

Barry, can I have your ACK on this?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-11 Thread Wei Yongjun
From: Wei Yongjun 

Using for_each_set_bit() to simplify the code.

Signed-off-by: Wei Yongjun 
---
 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);
}
}
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -next] pinctrl: sirf: using for_each_set_bit to simplify the code

2013-03-11 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Using for_each_set_bit() to simplify the code.

Signed-off-by: Wei Yongjun yongjun_...@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);
}
}
 }

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/