linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@uclinux.org>
To: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH 35/54] m68k: coldfire/gpio: Be sure to clamp return value
Date: Wed, 23 Dec 2015 21:51:45 +1000	[thread overview]
Message-ID: <567A8AD1.3070705@uclinux.org> (raw)
In-Reply-To: <1450795145-27292-1-git-send-email-linus.walleij@linaro.org>

Hi Linus,

On 23/12/15 00:39, Linus Walleij wrote:
> As we want gpio_chip .get() calls to be able to return negative
> error codes and propagate to drivers, we need to go over all
> drivers and make sure their return values are clamped to [0,1].
> We do this by using the ret = !!(val) design pattern.
>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Greg Ungerer <gerg@uclinux.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> M68K folks: as mentioned in 00/54: either apply this directly
> or ACK it and I will take it into the GPIO tree.

I will take via the m68knommu git tree.
I am pushing it up to the for-next branch now.

Thanks
Greg



> ---
>   arch/m68k/coldfire/gpio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/m68k/coldfire/gpio.c b/arch/m68k/coldfire/gpio.c
> index e7e428681ec5..37a83e27c7a6 100644
> --- a/arch/m68k/coldfire/gpio.c
> +++ b/arch/m68k/coldfire/gpio.c
> @@ -121,7 +121,7 @@ static int mcfgpio_direction_input(struct gpio_chip *chip, unsigned offset)
>
>   static int mcfgpio_get_value(struct gpio_chip *chip, unsigned offset)
>   {
> -	return __mcfgpio_get_value(offset);
> +	return !!__mcfgpio_get_value(offset);
>   }
>
>   static int mcfgpio_direction_output(struct gpio_chip *chip, unsigned offset,
>

  reply	other threads:[~2015-12-23 11:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22 14:39 [PATCH 35/54] m68k: coldfire/gpio: Be sure to clamp return value Linus Walleij
2015-12-23 11:51 ` Greg Ungerer [this message]
2015-12-25 12:45   ` 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=567A8AD1.3070705@uclinux.org \
    --to=gerg@uclinux.org \
    --cc=geert@linux-m68k.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@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).