Skip to contentSkip to conversation

hwmon: w83793d: remove redundant assignment to variable res

PATCH Applied Colin King 2 participants 2 messages Oct 11, 2019 – Oct 17, 2019

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 hwmon: w83793d: remove redundant assignment to variable res

From: Colin Ian King <[email protected]>

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")

---
 drivers/hwmon/w83793.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/w83793.c +1 -1
index 9df48b70c70c..a0307e6761b8 100644
@@ -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;
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

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")

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

Guenter

Quoted 17 lines
---
 drivers/hwmon/w83793.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/w83793.c +1 -1
index 9df48b70c70c..a0307e6761b8 100644
@@ -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;