From: "Kuppuswamy Sathyanarayanan" <sathyanarayanan.kuppuswamy@linux.intel.com>
To: "Jonathan Cameron" <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, "Jonathan Cameron" <jic23@kernel.org>,
"Kuppuswamy Sathyanarayanan"
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"Daniel Baluta" <daniel.baluta@intel.com>
Subject: Re: [PATCH] iio:light:ltr501 bug in parameter sanity check.
Date: Sat, 2 May 2015 08:31:39 -0700 (PDT) [thread overview]
Message-ID: <56744.10.252.205.185.1430580699.squirrel@linux.intel.com> (raw)
In-Reply-To: <1430562348-27802-1-git-send-email-jic23@kernel.org>
Good find. Please proceed with merge.
Acked-by: Kuppuswamy Sathyanarayanan
sathyanarayanan.kuppuswamy@linux.intel.com>
> Clearly the intent was to error if the value was not 0 or 1.
> As implemented we have (A != 0 || A != 1) which is always true
> as A is never both 0 and 1 at the same time.
>
> As the autobuilder suggested, && makes more sense for this error
> check.
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Cc: Kuppuswamy Sathyanarayanan
> <sathyanarayanan.kuppuswamy@linux.intel.com>
> Cc: Daniel Baluta <daniel.baluta@intel.com>
> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> ---
> This is obvious enough that I'll probably apply it shortly whether or
> not I get Acks. However, Acks always good!
>
> drivers/iio/light/ltr501.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
> index ca4bf470a332..280eff19b872 100644
> --- a/drivers/iio/light/ltr501.c
> +++ b/drivers/iio/light/ltr501.c
> @@ -976,7 +976,7 @@ static int ltr501_write_event_config(struct iio_dev
> *indio_dev,
> int ret;
>
> /* only 1 and 0 are valid inputs */
> - if (state != 1 || state != 0)
> + if (state != 1 && state != 0)
> return -EINVAL;
>
> switch (chan->type) {
> --
> 2.3.5
>
>
--
Sathyanarayanan Kuppuswamy
next prev parent reply other threads:[~2015-05-02 15:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-02 10:25 [PATCH] iio:light:ltr501 bug in parameter sanity check Jonathan Cameron
2015-05-02 15:31 ` Kuppuswamy Sathyanarayanan [this message]
2015-05-03 19:03 ` Jonathan Cameron
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=56744.10.252.205.185.1430580699.squirrel@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=daniel.baluta@intel.com \
--cc=jic23@kernel.org \
--cc=linux-iio@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.