* [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation
@ 2013-08-23 7:49 Axel Lin
2013-08-26 8:33 ` Heiko Stübner
2013-08-28 11:20 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2013-08-23 7:49 UTC (permalink / raw)
To: Linus Walleij; +Cc: Heiko Stübner, linux-kernel
If (b->pin_base + b->nr_pins - 1) < pin is true, pin >= b->pin_base is always
true because b->nr_pins is never less than 0.
Thus this patch simplify the equation.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/pinctrl/pinctrl-rockchip.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 319a64a..ea27806 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -186,8 +186,7 @@ static struct rockchip_pin_bank *pin_to_bank(struct rockchip_pinctrl *info,
{
struct rockchip_pin_bank *b = info->ctrl->pin_banks;
- while ((pin >= b->pin_base) &&
- ((b->pin_base + b->nr_pins - 1) < pin))
+ while (pin >= (b->pin_base + b->nr_pins))
b++;
return b;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation
2013-08-23 7:49 [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation Axel Lin
@ 2013-08-26 8:33 ` Heiko Stübner
2013-08-28 11:20 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Heiko Stübner @ 2013-08-26 8:33 UTC (permalink / raw)
To: Axel Lin; +Cc: Linus Walleij, linux-kernel
Am Freitag, 23. August 2013, 09:49:00 schrieb Axel Lin:
> If (b->pin_base + b->nr_pins - 1) < pin is true, pin >= b->pin_base is
> always true because b->nr_pins is never less than 0.
> Thus this patch simplify the equation.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
> ---
> drivers/pinctrl/pinctrl-rockchip.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c
> b/drivers/pinctrl/pinctrl-rockchip.c index 319a64a..ea27806 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -186,8 +186,7 @@ static struct rockchip_pin_bank *pin_to_bank(struct
> rockchip_pinctrl *info, {
> struct rockchip_pin_bank *b = info->ctrl->pin_banks;
>
> - while ((pin >= b->pin_base) &&
> - ((b->pin_base + b->nr_pins - 1) < pin))
> + while (pin >= (b->pin_base + b->nr_pins))
> b++;
>
> return b;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation
2013-08-23 7:49 [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation Axel Lin
2013-08-26 8:33 ` Heiko Stübner
@ 2013-08-28 11:20 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-08-28 11:20 UTC (permalink / raw)
To: Axel Lin; +Cc: Heiko Stübner, linux-kernel@vger.kernel.org
On Fri, Aug 23, 2013 at 9:49 AM, Axel Lin <axel.lin@ingics.com> wrote:
> If (b->pin_base + b->nr_pins - 1) < pin is true, pin >= b->pin_base is always
> true because b->nr_pins is never less than 0.
> Thus this patch simplify the equation.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Patch applied with Heiko's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-28 11:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-23 7:49 [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation Axel Lin
2013-08-26 8:33 ` Heiko Stübner
2013-08-28 11:20 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox