iio: light: cm36651: redundant assignment to variable ret
diff mbox series

Message ID 20190901152749.12916-1-colin.king@canonical.com
State New
Headers show
Series
  • iio: light: cm36651: redundant assignment to variable ret
Related show

Commit Message

Colin King Sept. 1, 2019, 3:27 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Variable ret is being assigned a value that is never read and
is being re-assigned a little later on. The assignment is redundant
and hence can be removed.

Addresses-Coverity: ("Ununsed value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iio/light/cm36651.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron Sept. 8, 2019, 11:38 a.m. UTC | #1
On Sun,  1 Sep 2019 16:27:49 +0100
Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable ret is being assigned a value that is never read and
> is being re-assigned a little later on. The assignment is redundant
> and hence can be removed.
> 
> Addresses-Coverity: ("Ununsed value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

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

Thanks,

Jonathan

> ---
>  drivers/iio/light/cm36651.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/cm36651.c b/drivers/iio/light/cm36651.c
> index 1019d625adb1..90e38fcc974b 100644
> --- a/drivers/iio/light/cm36651.c
> +++ b/drivers/iio/light/cm36651.c
> @@ -532,7 +532,7 @@ static int cm36651_write_prox_event_config(struct iio_dev *indio_dev,
>  					int state)
>  {
>  	struct cm36651_data *cm36651 = iio_priv(indio_dev);
> -	int cmd, ret = -EINVAL;
> +	int cmd, ret;
>  
>  	mutex_lock(&cm36651->lock);
>

Patch
diff mbox series

diff --git a/drivers/iio/light/cm36651.c b/drivers/iio/light/cm36651.c
index 1019d625adb1..90e38fcc974b 100644
--- a/drivers/iio/light/cm36651.c
+++ b/drivers/iio/light/cm36651.c
@@ -532,7 +532,7 @@  static int cm36651_write_prox_event_config(struct iio_dev *indio_dev,
 					int state)
 {
 	struct cm36651_data *cm36651 = iio_priv(indio_dev);
-	int cmd, ret = -EINVAL;
+	int cmd, ret;
 
 	mutex_lock(&cm36651->lock);