linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH] pinctrl: sh-pfc: gpio: Return early in gpio_pin_to_irq()
Date: Wed, 12 Feb 2020 15:59:40 +0100	[thread overview]
Message-ID: <20200212145940.GA3013231@oden.dyn.berto.se> (raw)
In-Reply-To: <20200212090200.11106-1-geert+renesas@glider.be>

Hi Geert,

Thanks for your patch.

On 2020-02-12 10:02:00 +0100, Geert Uytterhoeven wrote:
> As of commit 4adeabd042422cee ("pinctrl: sh-pfc: Remove hardcoded IRQ
> numbers"), only a single operation needs to be performed after finding
> the wanted pin.  Hence decrease the needed attention span of the casual
> reader by replacing the goto by a direct return.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
> To be queued in sh-pfc-for-v5.7.
> ---
>  drivers/pinctrl/sh-pfc/gpio.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c
> index 8213e118aa408573..9c6e931ae766edf7 100644
> --- a/drivers/pinctrl/sh-pfc/gpio.c
> +++ b/drivers/pinctrl/sh-pfc/gpio.c
> @@ -205,14 +205,11 @@ static int gpio_pin_to_irq(struct gpio_chip *gc, unsigned offset)
>  
>  		for (k = 0; gpios[k] >= 0; k++) {
>  			if (gpios[k] == offset)
> -				goto found;
> +				return pfc->irqs[i];
>  		}
>  	}
>  
>  	return 0;
> -
> -found:
> -	return pfc->irqs[i];
>  }
>  
>  static int gpio_pin_setup(struct sh_pfc_chip *chip)
> -- 
> 2.17.1
> 

-- 
Regards,
Niklas Söderlund

      reply	other threads:[~2020-02-12 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12  9:02 [PATCH] pinctrl: sh-pfc: gpio: Return early in gpio_pin_to_irq() Geert Uytterhoeven
2020-02-12 14:59 ` Niklas Söderlund [this message]

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=20200212145940.GA3013231@oden.dyn.berto.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-renesas-soc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).