pinctrl: rockchip: Simplify pin_to_bank equation

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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Axel Lin 2013-08-23 15:49:00 +08:00 committed by Linus Walleij
parent dff5a99c2a
commit 51578b9b1f

View file

@ -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; struct rockchip_pin_bank *b = info->ctrl->pin_banks;
while ((pin >= b->pin_base) && while (pin >= (b->pin_base + b->nr_pins))
((b->pin_base + b->nr_pins - 1) < pin))
b++; b++;
return b; return b;