diff mbox series

hwmon: w83793d: remove redundant assignment to variable res

Message ID 20191011170215.11539-1-colin.king@canonical.com (mailing list archive)
State Accepted
Headers show
Series hwmon: w83793d: remove redundant assignment to variable res | expand

Commit Message

Colin King Oct. 11, 2019, 5:02 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable res is being initialized with 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: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/hwmon/w83793.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck Oct. 17, 2019, 1:39 p.m. UTC | #1
On Fri, Oct 11, 2019 at 06:02:15PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable res is being initialized with 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: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied. Note that I removed the above Addreddes-Coverity tag as
it doesn't really make much sense.

Guenter

> ---
>  drivers/hwmon/w83793.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
> index 9df48b70c70c..a0307e6761b8 100644
> --- a/drivers/hwmon/w83793.c
> +++ b/drivers/hwmon/w83793.c
> @@ -2096,7 +2096,7 @@ static struct w83793_data *w83793_update_device(struct device *dev)
>  static u8 w83793_read_value(struct i2c_client *client, u16 reg)
>  {
>  	struct w83793_data *data = i2c_get_clientdata(client);
> -	u8 res = 0xff;
> +	u8 res;
>  	u8 new_bank = reg >> 8;
>  
>  	new_bank |= data->bank & 0xfc;
diff mbox series

Patch

diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index 9df48b70c70c..a0307e6761b8 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -2096,7 +2096,7 @@  static struct w83793_data *w83793_update_device(struct device *dev)
 static u8 w83793_read_value(struct i2c_client *client, u16 reg)
 {
 	struct w83793_data *data = i2c_get_clientdata(client);
-	u8 res = 0xff;
+	u8 res;
 	u8 new_bank = reg >> 8;
 
 	new_bank |= data->bank & 0xfc;