Skip to contentSkip to conversation

sensors/w83781d.c creates useless

PATCH New Frodo Looijaard 2 participants 2 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sensors/w83781d.c creates useless

----- Forwarded message from Kronos <[email protected]> -----

From: Kronos <[email protected]>
To: [email protected]
Cc: [email protected], Jindrich Makovicka <[email protected]>
Subject: Re: [patch] sensors/w83781d.c creates useless sysfs entries
Reply-To: [email protected]
X-Spam-Status: No, hits=-7.4 required=5.0 tests=IN_REP_TO,UNIFIED_PATCH,RCVD_IN_OSIRUSOFT_COM version=2.20 X-Spam-Level:

Jindrich Makovicka <[email protected]> ha scritto:

Quoted 5 lines

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:

drivers/i2c/chips/w83781d.c +3 -1
@@ -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

Signature · 11 lines
Reply-To: [email protected]
Home: http://kronoz.cjb.net
Windows NT: Designed for the Internet. The Internet: Designed for Unix.

----- End forwarded message -----

-- 
Frodo Looijaard <[email protected]>  PGP key and more: http://huizen.dds.nl/~frodol
Defenestration n. (formal or joc.):
  The act of removing Windows from your computer in disgust, usually followed
  by the installation of Linux or some other Unix-like operating system.
#1 lore raw

PATCH 1/1 sensors/w83781d.c creates

Quoted 10 lines · Frodo Looijaard

----- Forwarded message from Kronos <[email protected]> -----

From: Kronos <[email protected]>
To: [email protected]
Cc: [email protected], Jindrich Makovicka <[email protected]>
Subject: Re: [patch] sensors/w83781d.c creates useless sysfs entries
Reply-To: [email protected]
X-Spam-Status: No, hits=-7.4 required=5.0 tests=IN_REP_TO,UNIFIED_PATCH,RCVD_IN_OSIRUSOFT_COM version=2.20 X-Spam-Level:

Quoted 8 lines

Jindrich Makovicka <[email protected]> ha scritto:

Quoted 5 lines

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:

I'll take this fix, thanks.

Oh, and do you want to be removed from the MAINTAINERS list in the 2.6 kernel, so as to not receive these kinds of messages?

thanks,

greg k-h