All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Maxime Roussin-Bélanger" <maxime.roussinbelanger@gmail.com>,
	"Hartmut Knaack" <knaack.h@gmx.de>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
	"Jean-Francois Dagenais" <jeff.dagenais@gmail.com>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio: light: si1133: fix an && vs || typo
Date: Wed, 01 Aug 2018 17:59:07 +0000	[thread overview]
Message-ID: <20180801185907.3dd0cc81@archlinux> (raw)
In-Reply-To: <20180731181134.rp57ywlshwqm4onu@kili.mountain>

On Tue, 31 Jul 2018 21:11:34 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> The "val" variable can't be both 0 and 1 at the same time so this will
> always return -EINVAL.
> 
> Fixes: e01e7eaf37d8 ("iio: light: introduce si1133")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks.  This time Colin King beat you to it.

Jonathan

> 
> diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c
> index d3fbeb3bc463..5ac22c46da1f 100644
> --- a/drivers/iio/light/si1133.c
> +++ b/drivers/iio/light/si1133.c
> @@ -838,7 +838,7 @@ static int si1133_write_raw(struct iio_dev *iio_dev,
>  		switch (chan->type) {
>  		case IIO_INTENSITY:
>  		case IIO_UVINDEX:
> -			if (val != 0 || val != 1)
> +			if (val != 0 && val != 1)
>  				return -EINVAL;
>  
>  			return si1133_update_adcsens(data,


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Maxime Roussin-Bélanger" <maxime.roussinbelanger@gmail.com>,
	"Hartmut Knaack" <knaack.h@gmx.de>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
	"Jean-Francois Dagenais" <jeff.dagenais@gmail.com>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio: light: si1133: fix an && vs || typo
Date: Wed, 1 Aug 2018 18:59:07 +0100	[thread overview]
Message-ID: <20180801185907.3dd0cc81@archlinux> (raw)
In-Reply-To: <20180731181134.rp57ywlshwqm4onu@kili.mountain>

On Tue, 31 Jul 2018 21:11:34 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> The "val" variable can't be both 0 and 1 at the same time so this will
> always return -EINVAL.
> 
> Fixes: e01e7eaf37d8 ("iio: light: introduce si1133")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks.  This time Colin King beat you to it.

Jonathan

> 
> diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c
> index d3fbeb3bc463..5ac22c46da1f 100644
> --- a/drivers/iio/light/si1133.c
> +++ b/drivers/iio/light/si1133.c
> @@ -838,7 +838,7 @@ static int si1133_write_raw(struct iio_dev *iio_dev,
>  		switch (chan->type) {
>  		case IIO_INTENSITY:
>  		case IIO_UVINDEX:
> -			if (val != 0 || val != 1)
> +			if (val != 0 && val != 1)
>  				return -EINVAL;
>  
>  			return si1133_update_adcsens(data,


  reply	other threads:[~2018-08-01 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31 18:11 [PATCH] iio: light: si1133: fix an && vs || typo Dan Carpenter
2018-07-31 18:11 ` Dan Carpenter
2018-08-01 17:59 ` Jonathan Cameron [this message]
2018-08-01 17:59   ` 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=20180801185907.3dd0cc81@archlinux \
    --to=jic23@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jeff.dagenais@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=maxime.roussinbelanger@gmail.com \
    --cc=pmeerw@pmeerw.net \
    /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.