Skip to contentSkip to conversation

hwmon: (w83627ehf) Add missing break statement

PATCH Jean Delvare 1 participant 1 message Jul 7, 2012

lore
Share & tools
lore

Jean Delvare

author Acked-by
#0 lore raw
Quoted 14 lines · Guenter Roeck

A case statement in nct6775_write_fan_div() is missing a break. Fix it.

This patch addresses Coverity #141439: Missing break in switch.

---
 drivers/hwmon/w83627ehf.c |    1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/w83627ehf.c +0 -0
index 54922ed..1821b74 100644

drivers/hwmon/w83627ehf.c static void nct6775_write_fan_div(struct w83627ehf_data *data, int nr) · line 605

Quoted 7 lines
drivers/hwmon/w83627ehf.c +1 -0
@@ -599,6 +599,7 @@ static void nct6775_write_fan_div(struct w83627ehf_data *data, int nr)
 		reg = (w83627ehf_read_value(data, NCT6775_REG_FANDIV1) & 0x7)
 		    | ((data->fan_div[1] << 4) & 0x70);
 		w83627ehf_write_value(data, NCT6775_REG_FANDIV1, reg);
+		break;
 	case 2:
 		reg = (w83627ehf_read_value(data, NCT6775_REG_FANDIV2) & 0x70)
 		    | (data->fan_div[2] & 0x7);

Good catch, thankfully it is harmless as we are simply writing an unchanged value to the other register.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors