Skip to contentSkip to conversation

hwmon: (w83781d) Add missing curly braces

PATCH In review Jean Delvare 3 participants 3 messages Oct 25, 2007 – Oct 28, 2007 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (w83781d) Add missing curly braces

Missing curly braces cause an if statement to be evaluated when it shouldn't. It happens to be harmless, but that's still worth fixing. Thanks to Riku Voipio for reporting.

---
 drivers/hwmon/w83781d.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hwmon/w83781d.c +2 -1
@@ -1121,12 +1121,13 @@ w83781d_create_files(struct device *dev,
 				&sensor_dev_attr_temp3_beep.dev_attr)))
 			return err;
 
-		if (kind != w83781d)
+		if (kind != w83781d) {
 			err = sysfs_chmod_file(&dev->kobj,
 				&sensor_dev_attr_temp3_alarm.dev_attr.attr,
 				S_IRUGO | S_IWUSR);
 			if (err)
 				return err;
+		}
 	}
 
 	if (kind != w83781d && kind != as99127f) {
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines

Missing curly braces cause an if statement to be evaluated when it shouldn't. It happens to be harmless, but that's still worth fixing. Thanks to Riku Voipio for reporting.

This is clearly the correct fix:

Quoted 29 lines
---
 drivers/hwmon/w83781d.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.24-rc1.orig/drivers/hwmon/w83781d.c 2007-10-25
12:58:24.000000000 +0200
+++ linux-2.6.24-rc1/drivers/hwmon/w83781d.c 2007-10-25 13:06:00.000000000
+0200

drivers/hwmon/w83781d.c +2 -2
@@ -1121,12 +1121,13 @@ w83781d_create_files(struct device *dev,
 				&sensor_dev_attr_temp3_beep.dev_attr)))
 			return err;
 
-		if (kind != w83781d)
+		if (kind != w83781d) {
 			err = sysfs_chmod_file(&dev->kobj,
 				&sensor_dev_attr_temp3_alarm.dev_attr.attr,
 				S_IRUGO | S_IWUSR);
 			if (err)
 				return err;
+		}
 	}
 
 	if (kind != w83781d && kind != as99127f) {
 
 
--

Jean Delvare

Quoted 5 lines

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

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

#2 lore raw
In reply to Jean Delvare

Hi:

Quoted 4 lines · Voipio Riku
Quoted 3 lines

Missing curly braces cause an if statement to be evaluated when it shouldn't. It happens to be harmless, but that's still worth fixing. Thanks to Riku Voipio for reporting.

Quoted 8 lines

This is clearly the correct fix:

Quoted 4 lines
---
 drivers/hwmon/w83781d.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to hwmon-2.6.git/testing, thanks.

Signature · 8 lines
Mark M. Hoffman
[email protected]


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