Re: [patch] sensors/w83781d.c creates useless sysfs entries

From: Kronos
Date: Sat Oct 11 2003 - 11:33:55 EST


Jindrich Makovicka <makovick@xxxxxxxxxxxxxxxxxxxx> ha scritto:
> Hello,
>
> 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:

--- a/drivers/i2c/chips/w83781d.c Sun Sep 28 17:47:38 2003
+++ b/drivers/i2c/chips/w83781d.c Sat Oct 11 18:31:04 2003
@@ -422,9 +422,11 @@
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) \


Luca
--
Reply-To: kronos@xxxxxxxxxxxxxx
Home: http://kronoz.cjb.net
Windows NT: Designed for the Internet. The Internet: Designed for Unix.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/