diff mbox series

[01/30] iio: adc: ad_sigma_delta: Remove unused variable 'ret'

Message ID 20200716135928.1456727-2-lee.jones@linaro.org (mailing list archive)
State New, archived
Headers show
Series First batch of W=1 fixes for IIO | expand

Commit Message

Lee Jones July 16, 2020, 1:58 p.m. UTC
Fixes the following W=1 kernel build warning(s):

 drivers/iio/adc/ad_sigma_delta.c: In function ‘ad_sd_trigger_handler’:
 drivers/iio/adc/ad_sigma_delta.c:405:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
 405 | int ret;
 | ^~~

Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/iio/adc/ad_sigma_delta.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Jonathan Cameron July 18, 2020, 2:24 p.m. UTC | #1
On Thu, 16 Jul 2020 14:58:59 +0100
Lee Jones <lee.jones@linaro.org> wrote:

> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/adc/ad_sigma_delta.c: In function ‘ad_sd_trigger_handler’:
>  drivers/iio/adc/ad_sigma_delta.c:405:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
>  405 | int ret;
>  | ^~~
> 
> Cc: Michael Hennerich <Michael.Hennerich@analog.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Hi Lee,

My only thought on this one is perhaps we should put a warning in there
if ret isn't as expected.  Still never been one yet so I doubt anyone
minds too much.

Applied to the togreg branch of iio.git and pushed out as testing.
Note there is time for reviews from others before I push this out as
a non rebasing branch.  I'm also going to need to rebase it once
as previous pull hasn't quite gotten into staging/staging-next yet.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad_sigma_delta.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index dd3d54b3bc8bb..f269b926440da 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -402,7 +402,6 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>  	unsigned int reg_size;
>  	unsigned int data_reg;
>  	uint8_t data[16];
> -	int ret;
>  
>  	memset(data, 0x00, 16);
>  
> @@ -419,14 +418,12 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>  	case 4:
>  	case 2:
>  	case 1:
> -		ret = ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size,
> -			&data[0]);
> +		ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size, &data[0]);
>  		break;
>  	case 3:
>  		/* We store 24 bit samples in a 32 bit word. Keep the upper
>  		 * byte set to zero. */
> -		ret = ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size,
> -			&data[1]);
> +		ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size, &data[1]);
>  		break;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
index dd3d54b3bc8bb..f269b926440da 100644
--- a/drivers/iio/adc/ad_sigma_delta.c
+++ b/drivers/iio/adc/ad_sigma_delta.c
@@ -402,7 +402,6 @@  static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
 	unsigned int reg_size;
 	unsigned int data_reg;
 	uint8_t data[16];
-	int ret;
 
 	memset(data, 0x00, 16);
 
@@ -419,14 +418,12 @@  static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
 	case 4:
 	case 2:
 	case 1:
-		ret = ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size,
-			&data[0]);
+		ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size, &data[0]);
 		break;
 	case 3:
 		/* We store 24 bit samples in a 32 bit word. Keep the upper
 		 * byte set to zero. */
-		ret = ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size,
-			&data[1]);
+		ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size, &data[1]);
 		break;
 	}