Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH] iio: Fix iio_read_channel_processed_scale()
Date: Mon, 29 Mar 2021 13:26:48 +0100	[thread overview]
Message-ID: <20210329132648.1d18c0c1@jic23-huawei> (raw)
In-Reply-To: <20210323122705.1326362-1-linus.walleij@linaro.org>

On Tue, 23 Mar 2021 13:27:05 +0100
Linus Walleij <linus.walleij@linaro.org> wrote:

> The code was checking if (ret) from the processed
> channel readout, not smart, we need to check if (ret < 0)
> as this will likely be something like IIO_VAL_INT.
> 
> Fixes: dc98269f7c7d ("iio: Provide iio_read_channel_processed_scale() API")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Jonathan: this Fixes tag is the commit ID found in your
> testing branch, feel free to just squash if you prefer
> that.

Applied to the togreg branch of iio.git

Thanks,

Jonathan

> ---
>  drivers/iio/inkern.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index c61fc06f98b8..9c22697b7e83 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -702,7 +702,7 @@ int iio_read_channel_processed_scale(struct iio_channel *chan, int *val,
>  	if (iio_channel_has_info(chan->channel, IIO_CHAN_INFO_PROCESSED)) {
>  		ret = iio_channel_read(chan, val, NULL,
>  				       IIO_CHAN_INFO_PROCESSED);
> -		if (ret)
> +		if (ret < 0)
>  			goto err_unlock;
>  		*val *= scale;
>  	} else {


      reply	other threads:[~2021-03-29 12:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 12:27 [PATCH] iio: Fix iio_read_channel_processed_scale() Linus Walleij
2021-03-29 12:26 ` Jonathan Cameron [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=20210329132648.1d18c0c1@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox