All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Axel Lin <axel.lin@ingics.com>
Cc: Linus Walleij <linus.walleij@linaro.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation
Date: Mon, 26 Aug 2013 10:33:35 +0200	[thread overview]
Message-ID: <201308261033.35541.heiko@sntech.de> (raw)
In-Reply-To: <1377244140.24387.1.camel@phoenix>

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;


  reply	other threads:[~2013-08-26  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23  7:49 [PATCH] pinctrl: rockchip: Simplify pin_to_bank equation Axel Lin
2013-08-26  8:33 ` Heiko Stübner [this message]
2013-08-28 11:20 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201308261033.35541.heiko@sntech.de \
    --to=heiko@sntech.de \
    --cc=axel.lin@ingics.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.