Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1410631

Re: [PATCH 1/2] staging: iio: accel: fix error check

From Luis de Bethencourt <luisbg@osg.samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] staging: iio: accel: fix error check
Date 2016-05-31 23:20 +0200
Message-ID <rEZeW-7Pi-3@gated-at.bofh.it> (permalink)
References <rEZ5f-7LR-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 31/05/16 22:08, Luis de Bethencourt wrote:
> sca3000_read_ctrl_reg() returns a negative number on failure, check for
> this instead of zero.
> 
> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
> Reviewed-by: Andrew F. Davis <afd@ti.com>
> Reviewed-by: Jonathan Cameron <jic23@kernel.org>
> ---
> 
> Patch corrected thanks to comments from Andrew F. Davis and Jonathan Cameron.
> https://lkml.org/lkml/2016/5/31/862
> 
> Thanks,
> Luis
> 
>  drivers/staging/iio/accel/sca3000_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
> index a8f533a..ec12181 100644
> --- a/drivers/staging/iio/accel/sca3000_core.c
> +++ b/drivers/staging/iio/accel/sca3000_core.c
> @@ -594,7 +594,7 @@ static ssize_t sca3000_read_frequency(struct device *dev,
>  		goto error_ret_mut;
>  	ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_OUT_CTRL);
>  	mutex_unlock(&st->lock);
> -	if (ret)
> +	if (ret < 0)
>  		goto error_ret;
>  	val = ret;
>  	if (base_freq > 0)
> 

I sent this with git send-email using --subject-prefix="PATCH v2", no idea why the version wasn't
added.

Apologies,
Luis

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] staging: iio: accel: fix error check Luis de Bethencourt <luisbg@osg.samsung.com> - 2016-05-31 23:10 +0200
  [PATCH 2/2] staging: iio: accel: add error check Luis de Bethencourt <luisbg@osg.samsung.com> - 2016-05-31 23:10 +0200
  Re: [PATCH 1/2] staging: iio: accel: fix error check Luis de Bethencourt <luisbg@osg.samsung.com> - 2016-05-31 23:20 +0200

csiph-web