* [lm-sensors] [patchset 18/23] pc87360 refactor SENSOR_DEVICE_ATTR
@ 2005-08-02 0:56 Jim Cromie
0 siblings, 0 replies; only message in thread
From: Jim Cromie @ 2005-08-02 0:56 UTC (permalink / raw)
To: lm-sensors
refactor SENSOR_DEVICE_ATTR to separate the variable declaraion
and initialization from the initialization expression 'assigned' to it,
making it more friendly to array initialization.
[jimc@harpo pset]$ diffstat 15-sda-arry-initializer
hwmon-sysfs.h | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
-------------- next part --------------
diff -ruNp -X exclude-diffs lxE-5/include/linux/hwmon-sysfs.h lxF-1/include/linux/hwmon-sysfs.h
--- lxE-5/include/linux/hwmon-sysfs.h 2005-07-18 12:36:48.000000000 -0600
+++ lxF-1/include/linux/hwmon-sysfs.h 2005-08-01 10:23:15.000000000 -0600
@@ -27,10 +27,13 @@ struct sensor_device_attribute{
#define to_sensor_dev_attr(_dev_attr) \
container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
-#define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \
-struct sensor_device_attribute sensor_dev_attr_##_name = { \
- .dev_attr = __ATTR(_name,_mode,_show,_store), \
- .index = _index, \
+#define __SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \
+ { .dev_attr = __ATTR(_name,_mode,_show,_store), \
+ .index = _index, \
}
+#define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \
+struct sensor_device_attribute sensor_dev_attr_##_name \
+ = __SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index)
+
#endif /* _LINUX_HWMON_SYSFS_H */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-02 0:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-02 0:56 [lm-sensors] [patchset 18/23] pc87360 refactor SENSOR_DEVICE_ATTR Jim Cromie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.