linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: chemical: atlas-ezo-sensor: move ret variable scope in atlas_ezo_read_raw()
@ 2020-05-31  3:02 Matt Ranostay
  2020-05-31  8:36 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Ranostay @ 2020-05-31  3:02 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, Matt Ranostay

Move ret variable to the IIO_CHAN_INFO_RAW switch since currently
only used within that scope.

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/iio/chemical/atlas-ezo-sensor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/chemical/atlas-ezo-sensor.c b/drivers/iio/chemical/atlas-ezo-sensor.c
index f5a6d8ec6d4d..a94eb8a6bf32 100644
--- a/drivers/iio/chemical/atlas-ezo-sensor.c
+++ b/drivers/iio/chemical/atlas-ezo-sensor.c
@@ -69,13 +69,13 @@ static int atlas_ezo_read_raw(struct iio_dev *indio_dev,
 {
 	struct atlas_ezo_data *data = iio_priv(indio_dev);
 	struct i2c_client *client = data->client;
-	int ret = 0;
 
 	if (chan->type != IIO_CONCENTRATION)
 		return -EINVAL;
 
 	switch (mask) {
 	case IIO_CHAN_INFO_RAW: {
+		int ret;
 		long tmp;
 
 		mutex_lock(&data->lock);
@@ -110,7 +110,7 @@ static int atlas_ezo_read_raw(struct iio_dev *indio_dev,
 		return IIO_VAL_INT_PLUS_MICRO;
 	}
 
-	return ret;
+	return 0;
 }
 
 static const struct iio_info atlas_info = {
-- 
2.20.1


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

* Re: [PATCH] iio: chemical: atlas-ezo-sensor: move ret variable scope in atlas_ezo_read_raw()
  2020-05-31  3:02 [PATCH] iio: chemical: atlas-ezo-sensor: move ret variable scope in atlas_ezo_read_raw() Matt Ranostay
@ 2020-05-31  8:36 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2020-05-31  8:36 UTC (permalink / raw)
  To: Matt Ranostay; +Cc: linux-iio

On Sun, 31 May 2020 06:02:08 +0300
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> Move ret variable to the IIO_CHAN_INFO_RAW switch since currently
> only used within that scope.
> 
> Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/chemical/atlas-ezo-sensor.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/chemical/atlas-ezo-sensor.c b/drivers/iio/chemical/atlas-ezo-sensor.c
> index f5a6d8ec6d4d..a94eb8a6bf32 100644
> --- a/drivers/iio/chemical/atlas-ezo-sensor.c
> +++ b/drivers/iio/chemical/atlas-ezo-sensor.c
> @@ -69,13 +69,13 @@ static int atlas_ezo_read_raw(struct iio_dev *indio_dev,
>  {
>  	struct atlas_ezo_data *data = iio_priv(indio_dev);
>  	struct i2c_client *client = data->client;
> -	int ret = 0;
>  
>  	if (chan->type != IIO_CONCENTRATION)
>  		return -EINVAL;
>  
>  	switch (mask) {
>  	case IIO_CHAN_INFO_RAW: {
> +		int ret;
>  		long tmp;
>  
>  		mutex_lock(&data->lock);
> @@ -110,7 +110,7 @@ static int atlas_ezo_read_raw(struct iio_dev *indio_dev,
>  		return IIO_VAL_INT_PLUS_MICRO;
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static const struct iio_info atlas_info = {


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

end of thread, other threads:[~2020-05-31  8:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31  3:02 [PATCH] iio: chemical: atlas-ezo-sensor: move ret variable scope in atlas_ezo_read_raw() Matt Ranostay
2020-05-31  8:36 ` 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).