linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] staging: iio: cdc: fix improper return value
@ 2016-12-03 13:44 Pan Bian
  2016-12-04 10:58 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Pan Bian @ 2016-12-03 13:44 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: linux-iio, devel, linux-kernel, Pan Bian

From: Pan Bian <bianpan2016@163.com>

At the end of function ad7150_write_event_config(), directly returns 0.
As a result, the errors will be ignored by the callers. It may be better 
to return variable "ret".

Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 drivers/staging/iio/cdc/ad7150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
index 5578a07..50a5b0c2 100644
--- a/drivers/staging/iio/cdc/ad7150.c
+++ b/drivers/staging/iio/cdc/ad7150.c
@@ -274,7 +274,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
 error_ret:
 	mutex_unlock(&chip->state_lock);
 
-	return 0;
+	return ret;
 }
 
 static int ad7150_read_event_value(struct iio_dev *indio_dev,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] staging: iio: cdc: fix improper return value
  2016-12-03 13:44 [PATCH 1/1] staging: iio: cdc: fix improper return value Pan Bian
@ 2016-12-04 10:58 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2016-12-04 10:58 UTC (permalink / raw)
  To: Pan Bian, Lars-Peter Clausen, Michael Hennerich, Hartmut Knaack,
	Peter Meerwald-Stadler, Greg Kroah-Hartman
  Cc: linux-iio, devel, linux-kernel, Pan Bian

On 03/12/16 13:44, Pan Bian wrote:
> From: Pan Bian <bianpan2016@163.com>
> 
> At the end of function ad7150_write_event_config(), directly returns 0.
> As a result, the errors will be ignored by the callers. It may be better 
> to return variable "ret".
> 
> Signed-off-by: Pan Bian <bianpan2016@163.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/staging/iio/cdc/ad7150.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
> index 5578a07..50a5b0c2 100644
> --- a/drivers/staging/iio/cdc/ad7150.c
> +++ b/drivers/staging/iio/cdc/ad7150.c
> @@ -274,7 +274,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
>  error_ret:
>  	mutex_unlock(&chip->state_lock);
>  
> -	return 0;
> +	return ret;
>  }
>  
>  static int ad7150_read_event_value(struct iio_dev *indio_dev,
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-04 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-03 13:44 [PATCH 1/1] staging: iio: cdc: fix improper return value Pan Bian
2016-12-04 10:58 ` Jonathan Cameron

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).