linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <acourbot@nvidia.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Alexandre Courbot <gnurou@gmail.com>
Subject: Re: [PATCH] gpio: clamp returned values to the boolean range
Date: Tue, 04 Mar 2014 18:04:47 -0800	[thread overview]
Message-ID: <1393985087.3271.21.camel@joe-AO722> (raw)
In-Reply-To: <CACRpkdY-oBdxxWhsGraEU31qyu+RWJAiRA+KEip6QNW3jRwGUA@mail.gmail.com>

On Wed, 2014-03-05 at 09:49 +0800, Linus Walleij wrote:
> On Wed, Feb 26, 2014 at 9:40 AM, Alexandre Courbot <acourbot@nvidia.com> wrote:
> 
> > Nothing prevents GPIO drivers from returning values outside the
> > boolean range, and as it turns out a few drivers are actually doing so.
> > These values were passed as-is to unsuspecting consumers and created
> > confusion.
> >
> > This patch makes the internal _gpiod_get_raw_value() function return a
> > bool, effectively clamping the GPIO value to the boolean range no
> > matter what the driver does.
> 
> No, that will not be the semantic effect of this patch, bool is just
> another name for an int, maybe some static checkers will be able
> to use it however.

No, a bool is not an int.

It's really different.
include/linux/types.h:typedef _Bool                     bool;

  reply	other threads:[~2014-03-05  2:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26  1:40 [PATCH] gpio: clamp returned values to the boolean range Alexandre Courbot
2014-03-05  1:49 ` Linus Walleij
2014-03-05  2:04   ` Joe Perches [this message]
2014-03-05  2:14     ` Alexandre Courbot
2014-03-05  2:19       ` Joe Perches
2014-03-05  2:22         ` Alexandre Courbot
2014-03-05  2:33           ` Linus Walleij
2014-03-05  3:09             ` Joe Perches

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=1393985087.3271.21.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=acourbot@nvidia.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.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 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).