All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: cpcap-adc: remove redundant assignment to variable cal_data_diff
@ 2022-02-07 13:59 Colin Ian King
  2022-02-07 20:40 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-02-07 13:59 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio; +Cc: kernel-janitors, linux-kernel

The variable cal_data_diff is being assigned a value that is never read,
it is being re-assigned later on with a new value in both paths of an
if statement. The assignment is redundant, so remove it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/iio/adc/cpcap-adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/cpcap-adc.c b/drivers/iio/adc/cpcap-adc.c
index 40e59f4c95bc..b6c4ef70484e 100644
--- a/drivers/iio/adc/cpcap-adc.c
+++ b/drivers/iio/adc/cpcap-adc.c
@@ -474,7 +474,7 @@ static int cpcap_adc_calibrate_one(struct cpcap_adc *ddata,
 	for (i = 0; i < CPCAP_ADC_MAX_RETRIES; i++) {
 		calibration_data[0]  = 0;
 		calibration_data[1]  = 0;
-		cal_data_diff = 0;
+
 		cpcap_adc_setup_calibrate(ddata, channel);
 		error = regmap_read(ddata->reg, calibration_register,
 				    &calibration_data[0]);
-- 
2.34.1


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

* Re: [PATCH] iio: adc: cpcap-adc: remove redundant assignment to variable cal_data_diff
  2022-02-07 13:59 [PATCH] iio: adc: cpcap-adc: remove redundant assignment to variable cal_data_diff Colin Ian King
@ 2022-02-07 20:40 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-02-07 20:40 UTC (permalink / raw)
  To: Colin Ian King; +Cc: linux-iio, kernel-janitors, linux-kernel

On Mon,  7 Feb 2022 13:59:43 +0000
Colin Ian King <colin.i.king@gmail.com> wrote:

> The variable cal_data_diff is being assigned a value that is never read,
> it is being re-assigned later on with a new value in both paths of an
> if statement. The assignment is redundant, so remove it.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/cpcap-adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/cpcap-adc.c b/drivers/iio/adc/cpcap-adc.c
> index 40e59f4c95bc..b6c4ef70484e 100644
> --- a/drivers/iio/adc/cpcap-adc.c
> +++ b/drivers/iio/adc/cpcap-adc.c
> @@ -474,7 +474,7 @@ static int cpcap_adc_calibrate_one(struct cpcap_adc *ddata,
>  	for (i = 0; i < CPCAP_ADC_MAX_RETRIES; i++) {
>  		calibration_data[0]  = 0;
>  		calibration_data[1]  = 0;
> -		cal_data_diff = 0;
> +
>  		cpcap_adc_setup_calibrate(ddata, channel);
>  		error = regmap_read(ddata->reg, calibration_register,
>  				    &calibration_data[0]);


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

end of thread, other threads:[~2022-02-07 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 13:59 [PATCH] iio: adc: cpcap-adc: remove redundant assignment to variable cal_data_diff Colin Ian King
2022-02-07 20:40 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.