Skip to contentSkip to conversation

hwmon: (asc7621): remove redundant assignment to newval

PATCH Applied Colin King 2 participants 2 messages Oct 18, 2017 – Oct 21, 2017

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 hwmon: (asc7621): remove redundant assignment to newval

From: Colin Ian King <[email protected]>

The setting of newval to zero is redundant as the following if/else stanzas will always update newval to a new value. Remove the redundant setting, cleans up clang build warning:

drivers/hwmon/asc7621.c:582:2: warning: Value stored to 'newval' is never read

---
 drivers/hwmon/asc7621.c | 1 -
 1 file changed, 1 deletion(-)
drivers/hwmon/asc7621.c +0 -1
index 4875e99b59c9..6d34c05a4f83 100644
@@ -579,7 +579,6 @@ static ssize_t show_pwm_enable(struct device *dev,
 	mutex_unlock(&data->update_lock);
 
 	val = config | (altbit << 3);
-	newval = 0;
 
 	if (val = 3 || val >= 10)
 		newval = 255;
Signature · 1 line
2.14.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Colin Ian King

From: Colin Ian King <[email protected]>

The setting of newval to zero is redundant as the following if/else stanzas will always update newval to a new value. Remove the redundant setting, cleans up clang build warning:

drivers/hwmon/asc7621.c:582:2: warning: Value stored to 'newval' is never read

Applied to hwmon-next.

Thanks,
Guenter

Quoted 16 lines
---
 drivers/hwmon/asc7621.c | 1 -
 1 file changed, 1 deletion(-)
drivers/hwmon/asc7621.c +0 -1
index 4875e99b59c9..6d34c05a4f83 100644
@@ -579,7 +579,6 @@ static ssize_t show_pwm_enable(struct device *dev,
 	mutex_unlock(&data->update_lock);
 
 	val = config | (altbit << 3);
-	newval = 0;
 
 	if (val = 3 || val >= 10)
 		newval = 255;