]> git.hungrycats.org Git - linux/commitdiff
[PATCH] I2C: sensors/w83781d.c creates useless sysfs entries
authorLuca Tettamanti <kronos@kronoz.cjb.net>
Mon, 13 Oct 2003 05:31:27 +0000 (22:31 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 13 Oct 2003 05:31:27 +0000 (22:31 -0700)
Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz> ha scritto:
> here is a trivial fix for Winbond sensor driver, which currently creates
> useless entries in sys/bus/i2c due to missing braces after if statements
> - author probably forgot about the macro expansion.

IMHO it's better to fix the macro:

drivers/i2c/chips/w83781d.c

index 40f183f4f217801a105dc799db03178ab3a4c6ce..8cc3177e45494c1043c4ff38a4f13709e0c6c0da 100644 (file)
@@ -422,9 +422,11 @@ sysfs_in_offsets(7);
 sysfs_in_offsets(8);
 
 #define device_create_file_in(client, offset) \
+do { \
 device_create_file(&client->dev, &dev_attr_in_input##offset); \
 device_create_file(&client->dev, &dev_attr_in_min##offset); \
-device_create_file(&client->dev, &dev_attr_in_max##offset);
+device_create_file(&client->dev, &dev_attr_in_max##offset); \
+} while (0);
 
 #define show_fan_reg(reg) \
 static ssize_t show_##reg (struct device *dev, char *buf, int nr) \