]> git.hungrycats.org Git - linux/commitdiff
[PATCH] i2c: kill some sensors driver macro abuse
authorMark M. Hoffman <mhoffman@lightlink.com>
Wed, 29 Sep 2004 06:41:52 +0000 (23:41 -0700)
committerGreg Kroah-Hartman <greg@press.kroah.org>
Wed, 29 Sep 2004 06:41:52 +0000 (23:41 -0700)
This patch kills a specific kind of ugly and ultimately useless macro
abuse found in many sensors chip drivers.  Compile tested only.

Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/i2c/chips/adm1031.c
drivers/i2c/chips/asb100.c
drivers/i2c/chips/it87.c
drivers/i2c/chips/lm78.c
drivers/i2c/chips/lm85.c
drivers/i2c/chips/smsc47m1.c
drivers/i2c/chips/via686a.c
drivers/i2c/chips/w83627hf.c
drivers/i2c/chips/w83781d.c

index 59cf1a8b2ca4a2eb0f982b038791b655c1b2fc43..23fb4f0f9957da2b01a7665e1d8a335cccc90425 100644 (file)
@@ -298,12 +298,12 @@ set_fan_auto_channel(struct device *dev, const char *buf, size_t count, int nr)
 #define fan_auto_channel_offset(offset)                                                \
 static ssize_t show_fan_auto_channel_##offset (struct device *dev, char *buf)  \
 {                                                                              \
-       return show_fan_auto_channel(dev, buf, 0x##offset - 1);                 \
+       return show_fan_auto_channel(dev, buf, offset - 1);                     \
 }                                                                              \
 static ssize_t set_fan_auto_channel_##offset (struct device *dev,              \
        const char *buf, size_t count)                                          \
 {                                                                              \
-       return set_fan_auto_channel(dev, buf, count, 0x##offset - 1);           \
+       return set_fan_auto_channel(dev, buf, count, offset - 1);               \
 }                                                                              \
 static DEVICE_ATTR(auto_fan##offset##_channel, S_IRUGO | S_IWUSR,              \
                   show_fan_auto_channel_##offset,                              \
@@ -365,25 +365,25 @@ set_auto_temp_max(struct device *dev, const char *buf, size_t count, int nr)
 #define auto_temp_reg(offset)                                                  \
 static ssize_t show_auto_temp_##offset##_off (struct device *dev, char *buf)   \
 {                                                                              \
-       return show_auto_temp_off(dev, buf, 0x##offset - 1);                    \
+       return show_auto_temp_off(dev, buf, offset - 1);                        \
 }                                                                              \
 static ssize_t show_auto_temp_##offset##_min (struct device *dev, char *buf)   \
 {                                                                              \
-       return show_auto_temp_min(dev, buf, 0x##offset - 1);                    \
+       return show_auto_temp_min(dev, buf, offset - 1);                        \
 }                                                                              \
 static ssize_t show_auto_temp_##offset##_max (struct device *dev, char *buf)   \
 {                                                                              \
-       return show_auto_temp_max(dev, buf, 0x##offset - 1);                    \
+       return show_auto_temp_max(dev, buf, offset - 1);                        \
 }                                                                              \
 static ssize_t set_auto_temp_##offset##_min (struct device *dev,               \
                                             const char *buf, size_t count)     \
 {                                                                              \
-       return set_auto_temp_min(dev, buf, count, 0x##offset - 1);              \
+       return set_auto_temp_min(dev, buf, count, offset - 1);          \
 }                                                                              \
 static ssize_t set_auto_temp_##offset##_max (struct device *dev,               \
                                             const char *buf, size_t count)     \
 {                                                                              \
-       return set_auto_temp_max(dev, buf, count, 0x##offset - 1);              \
+       return set_auto_temp_max(dev, buf, count, offset - 1);          \
 }                                                                              \
 static DEVICE_ATTR(auto_temp##offset##_off, S_IRUGO,                           \
                   show_auto_temp_##offset##_off, NULL);                        \
@@ -429,12 +429,12 @@ set_pwm(struct device *dev, const char *buf, size_t count, int nr)
 #define pwm_reg(offset)                                                        \
 static ssize_t show_pwm_##offset (struct device *dev, char *buf)       \
 {                                                                      \
-       return show_pwm(dev, buf, 0x##offset - 1);                      \
+       return show_pwm(dev, buf, offset - 1);                  \
 }                                                                      \
 static ssize_t set_pwm_##offset (struct device *dev,                   \
                                 const char *buf, size_t count)         \
 {                                                                      \
-       return set_pwm(dev, buf, count, 0x##offset - 1);                \
+       return set_pwm(dev, buf, count, offset - 1);            \
 }                                                                      \
 static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR,                     \
                   show_pwm_##offset, set_pwm_##offset)
@@ -565,25 +565,25 @@ set_fan_div(struct device *dev, const char *buf, size_t count, int nr)
 #define fan_offset(offset)                                             \
 static ssize_t show_fan_##offset (struct device *dev, char *buf)       \
 {                                                                      \
-       return show_fan(dev, buf, 0x##offset - 1);                      \
+       return show_fan(dev, buf, offset - 1);                  \
 }                                                                      \
 static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \
 {                                                                      \
-       return show_fan_min(dev, buf, 0x##offset - 1);                  \
+       return show_fan_min(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \
 {                                                                      \
-       return show_fan_div(dev, buf, 0x##offset - 1);                  \
+       return show_fan_div(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t set_fan_##offset##_min (struct device *dev,             \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_fan_min(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_min(dev, buf, count, offset - 1);                \
 }                                                                      \
 static ssize_t set_fan_##offset##_div (struct device *dev,             \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_fan_div(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_div(dev, buf, count, offset - 1);                \
 }                                                                      \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset,    \
                   NULL);                                               \
@@ -675,34 +675,34 @@ set_temp_crit(struct device *dev, const char *buf, size_t count, int nr)
 #define temp_reg(offset)                                                       \
 static ssize_t show_temp_##offset (struct device *dev, char *buf)              \
 {                                                                              \
-       return show_temp(dev, buf, 0x##offset - 1);                             \
+       return show_temp(dev, buf, offset - 1);                         \
 }                                                                              \
 static ssize_t show_temp_##offset##_min (struct device *dev, char *buf)                \
 {                                                                              \
-       return show_temp_min(dev, buf, 0x##offset - 1);                         \
+       return show_temp_min(dev, buf, offset - 1);                             \
 }                                                                              \
 static ssize_t show_temp_##offset##_max (struct device *dev, char *buf)                \
 {                                                                              \
-       return show_temp_max(dev, buf, 0x##offset - 1);                         \
+       return show_temp_max(dev, buf, offset - 1);                             \
 }                                                                              \
 static ssize_t show_temp_##offset##_crit (struct device *dev, char *buf)       \
 {                                                                              \
-       return show_temp_crit(dev, buf, 0x##offset - 1);                        \
+       return show_temp_crit(dev, buf, offset - 1);                    \
 }                                                                              \
 static ssize_t set_temp_##offset##_min (struct device *dev,                    \
                                        const char *buf, size_t count)          \
 {                                                                              \
-       return set_temp_min(dev, buf, count, 0x##offset - 1);                   \
+       return set_temp_min(dev, buf, count, offset - 1);                       \
 }                                                                              \
 static ssize_t set_temp_##offset##_max (struct device *dev,                    \
                                        const char *buf, size_t count)          \
 {                                                                              \
-       return set_temp_max(dev, buf, count, 0x##offset - 1);                   \
+       return set_temp_max(dev, buf, count, offset - 1);                       \
 }                                                                              \
 static ssize_t set_temp_##offset##_crit (struct device *dev,                   \
                                         const char *buf, size_t count)         \
 {                                                                              \
-       return set_temp_crit(dev, buf, count, 0x##offset - 1);                  \
+       return set_temp_crit(dev, buf, count, offset - 1);                      \
 }                                                                              \
 static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset,          \
                   NULL);                                                       \
index 190ed5baed2020aef266611a5fd058246df7231d..3c3b731f0e41f06597a6253b403e87f031e874fc 100644 (file)
@@ -266,29 +266,29 @@ set_in_reg(MAX, max)
 static ssize_t \
        show_in##offset (struct device *dev, char *buf) \
 { \
-       return show_in(dev, buf, 0x##offset); \
+       return show_in(dev, buf, offset); \
 } \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
                show_in##offset, NULL); \
 static ssize_t \
        show_in##offset##_min (struct device *dev, char *buf) \
 { \
-       return show_in_min(dev, buf, 0x##offset); \
+       return show_in_min(dev, buf, offset); \
 } \
 static ssize_t \
        show_in##offset##_max (struct device *dev, char *buf) \
 { \
-       return show_in_max(dev, buf, 0x##offset); \
+       return show_in_max(dev, buf, offset); \
 } \
 static ssize_t set_in##offset##_min (struct device *dev, \
                const char *buf, size_t count) \
 { \
-       return set_in_min(dev, buf, count, 0x##offset); \
+       return set_in_min(dev, buf, count, offset); \
 } \
 static ssize_t set_in##offset##_max (struct device *dev, \
                const char *buf, size_t count) \
 { \
-       return set_in_max(dev, buf, count, 0x##offset); \
+       return set_in_max(dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
                show_in##offset##_min, set_in##offset##_min); \
index 07eda253e021b5b65c37e57f645b762ce78c314e..6b98a0383b3b8672a46eaf671029c49582185455 100644 (file)
@@ -273,7 +273,7 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
 static ssize_t                                                 \
        show_in##offset (struct device *dev, char *buf)         \
 {                                                              \
-       return show_in(dev, buf, 0x##offset);                   \
+       return show_in(dev, buf, offset);                       \
 }                                                              \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);
 
@@ -281,22 +281,22 @@ static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);
 static ssize_t                                                 \
        show_in##offset##_min (struct device *dev, char *buf)   \
 {                                                              \
-       return show_in_min(dev, buf, 0x##offset);               \
+       return show_in_min(dev, buf, offset);                   \
 }                                                              \
 static ssize_t                                                 \
        show_in##offset##_max (struct device *dev, char *buf)   \
 {                                                              \
-       return show_in_max(dev, buf, 0x##offset);               \
+       return show_in_max(dev, buf, offset);                   \
 }                                                              \
 static ssize_t set_in##offset##_min (struct device *dev,       \
                const char *buf, size_t count)                  \
 {                                                              \
-       return set_in_min(dev, buf, count, 0x##offset);         \
+       return set_in_min(dev, buf, count, offset);             \
 }                                                              \
 static ssize_t set_in##offset##_max (struct device *dev,       \
                        const char *buf, size_t count)          \
 {                                                              \
-       return set_in_max(dev, buf, count, 0x##offset);         \
+       return set_in_max(dev, buf, count, offset);             \
 }                                                              \
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,        \
                show_in##offset##_min, set_in##offset##_min);   \
@@ -360,27 +360,27 @@ static ssize_t set_temp_min(struct device *dev, const char *buf,
 #define show_temp_offset(offset)                                       \
 static ssize_t show_temp_##offset (struct device *dev, char *buf)      \
 {                                                                      \
-       return show_temp(dev, buf, 0x##offset - 1);                     \
+       return show_temp(dev, buf, offset - 1);                         \
 }                                                                      \
 static ssize_t                                                         \
 show_temp_##offset##_max (struct device *dev, char *buf)               \
 {                                                                      \
-       return show_temp_max(dev, buf, 0x##offset - 1);                 \
+       return show_temp_max(dev, buf, offset - 1);                     \
 }                                                                      \
 static ssize_t                                                         \
 show_temp_##offset##_min (struct device *dev, char *buf)               \
 {                                                                      \
-       return show_temp_min(dev, buf, 0x##offset - 1);                 \
+       return show_temp_min(dev, buf, offset - 1);                     \
 }                                                                      \
 static ssize_t set_temp_##offset##_max (struct device *dev,            \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_temp_max(dev, buf, count, 0x##offset - 1);           \
+       return set_temp_max(dev, buf, count, offset - 1);               \
 }                                                                      \
 static ssize_t set_temp_##offset##_min (struct device *dev,            \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_temp_min(dev, buf, count, 0x##offset - 1);           \
+       return set_temp_min(dev, buf, count, offset - 1);               \
 }                                                                      \
 static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \
 static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR,              \
@@ -423,12 +423,12 @@ static ssize_t set_sensor(struct device *dev, const char *buf,
 #define show_sensor_offset(offset)                                     \
 static ssize_t show_sensor_##offset (struct device *dev, char *buf)    \
 {                                                                      \
-       return show_sensor(dev, buf, 0x##offset - 1);                   \
+       return show_sensor(dev, buf, offset - 1);                       \
 }                                                                      \
 static ssize_t set_sensor_##offset (struct device *dev,                \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_sensor(dev, buf, count, 0x##offset - 1);             \
+       return set_sensor(dev, buf, count, offset - 1);                 \
 }                                                                      \
 static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR,             \
                show_sensor_##offset, set_sensor_##offset);
@@ -505,25 +505,25 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
 #define show_fan_offset(offset)                                                \
 static ssize_t show_fan_##offset (struct device *dev, char *buf)       \
 {                                                                      \
-       return show_fan(dev, buf, 0x##offset - 1);                      \
+       return show_fan(dev, buf, offset - 1);                          \
 }                                                                      \
 static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \
 {                                                                      \
-       return show_fan_min(dev, buf, 0x##offset - 1);                  \
+       return show_fan_min(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \
 {                                                                      \
-       return show_fan_div(dev, buf, 0x##offset - 1);                  \
+       return show_fan_div(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t set_fan_##offset##_min (struct device *dev,             \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_fan_min(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_min(dev, buf, count, offset - 1);                \
 }                                                                      \
 static ssize_t set_fan_##offset##_div (struct device *dev,             \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_fan_div(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_div(dev, buf, count, offset - 1);                \
 }                                                                      \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR,               \
index e8fa1cc7cfee296006c3ba45e296892aa1730bdd..e8ac16a8e91bc54bf9c13c72fba7429443442577 100644 (file)
@@ -229,29 +229,29 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
 static ssize_t                                                 \
        show_in##offset (struct device *dev, char *buf)         \
 {                                                              \
-       return show_in(dev, buf, 0x##offset);                   \
+       return show_in(dev, buf, offset);                       \
 }                                                              \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO,                \
                show_in##offset, NULL);                         \
 static ssize_t                                                 \
        show_in##offset##_min (struct device *dev, char *buf)   \
 {                                                              \
-       return show_in_min(dev, buf, 0x##offset);               \
+       return show_in_min(dev, buf, offset);                   \
 }                                                              \
 static ssize_t                                                 \
        show_in##offset##_max (struct device *dev, char *buf)   \
 {                                                              \
-       return show_in_max(dev, buf, 0x##offset);               \
+       return show_in_max(dev, buf, offset);                   \
 }                                                              \
 static ssize_t set_in##offset##_min (struct device *dev,       \
                const char *buf, size_t count)                  \
 {                                                              \
-       return set_in_min(dev, buf, count, 0x##offset);         \
+       return set_in_min(dev, buf, count, offset);             \
 }                                                              \
 static ssize_t set_in##offset##_max (struct device *dev,       \
                const char *buf, size_t count)                  \
 {                                                              \
-       return set_in_max(dev, buf, count, 0x##offset);         \
+       return set_in_max(dev, buf, count, offset);             \
 }                                                              \
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,                \
                show_in##offset##_min, set_in##offset##_min);   \
@@ -375,20 +375,20 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
 #define show_fan_offset(offset)                                                \
 static ssize_t show_fan_##offset (struct device *dev, char *buf)       \
 {                                                                      \
-       return show_fan(dev, buf, 0x##offset - 1);                      \
+       return show_fan(dev, buf, offset - 1);                          \
 }                                                                      \
 static ssize_t show_fan_##offset##_min (struct device *dev, char *buf)  \
 {                                                                      \
-       return show_fan_min(dev, buf, 0x##offset - 1);                  \
+       return show_fan_min(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t show_fan_##offset##_div (struct device *dev, char *buf)  \
 {                                                                      \
-       return show_fan_div(dev, buf, 0x##offset - 1);                  \
+       return show_fan_div(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t set_fan_##offset##_min (struct device *dev,             \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_fan_min(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_min(dev, buf, count, offset - 1);                \
 }                                                                      \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR,               \
index ad56a898d33b09f0f9a2847836cb6a9939f8d77c..088e625c7b0d4499ce1d5b051a6e254283fee0a0 100644 (file)
@@ -437,16 +437,16 @@ static ssize_t set_fan_min(struct device *dev, const char *buf,
 #define show_fan_offset(offset)                                                \
 static ssize_t show_fan_##offset (struct device *dev, char *buf)       \
 {                                                                      \
-       return show_fan(dev, buf, 0x##offset - 1);                      \
+       return show_fan(dev, buf, offset - 1);                          \
 }                                                                      \
 static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \
 {                                                                      \
-       return show_fan_min(dev, buf, 0x##offset - 1);                  \
+       return show_fan_min(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t set_fan_##offset##_min (struct device *dev,             \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_fan_min(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_min(dev, buf, count, offset - 1);                \
 }                                                                      \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR,               \
@@ -527,16 +527,16 @@ static ssize_t show_pwm_enable(struct device *dev, char *buf, int nr)
 #define show_pwm_reg(offset)                                           \
 static ssize_t show_pwm_##offset (struct device *dev, char *buf)       \
 {                                                                      \
-       return show_pwm(dev, buf, 0x##offset - 1);                      \
+       return show_pwm(dev, buf, offset - 1);                          \
 }                                                                      \
 static ssize_t set_pwm_##offset (struct device *dev,                   \
                                 const char *buf, size_t count)         \
 {                                                                      \
-       return set_pwm(dev, buf, count, 0x##offset - 1);                \
+       return set_pwm(dev, buf, count, offset - 1);                    \
 }                                                                      \
 static ssize_t show_pwm_enable##offset (struct device *dev, char *buf) \
 {                                                                      \
-       return show_pwm_enable(dev, buf, 0x##offset - 1);                       \
+       return show_pwm_enable(dev, buf, offset - 1);                   \
 }                                                                      \
 static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR,                     \
                show_pwm_##offset, set_pwm_##offset);                   \
@@ -595,25 +595,25 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
 #define show_in_reg(offset)                                            \
 static ssize_t show_in_##offset (struct device *dev, char *buf)                \
 {                                                                      \
-       return show_in(dev, buf, 0x##offset);                           \
+       return show_in(dev, buf, offset);                               \
 }                                                                      \
 static ssize_t show_in_##offset##_min (struct device *dev, char *buf)  \
 {                                                                      \
-       return show_in_min(dev, buf, 0x##offset);                       \
+       return show_in_min(dev, buf, offset);                           \
 }                                                                      \
 static ssize_t show_in_##offset##_max (struct device *dev, char *buf)  \
 {                                                                      \
-       return show_in_max(dev, buf, 0x##offset);                       \
+       return show_in_max(dev, buf, offset);                           \
 }                                                                      \
 static ssize_t set_in_##offset##_min (struct device *dev,              \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_in_min(dev, buf, count, 0x##offset);                 \
+       return set_in_min(dev, buf, count, offset);                     \
 }                                                                      \
 static ssize_t set_in_##offset##_max (struct device *dev,              \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_in_max(dev, buf, count, 0x##offset);                 \
+       return set_in_max(dev, buf, count, offset);                     \
 }                                                                      \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in_##offset, NULL);       \
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,                \
@@ -675,25 +675,25 @@ static ssize_t set_temp_max(struct device *dev, const char *buf,
 #define show_temp_reg(offset)                                          \
 static ssize_t show_temp_##offset (struct device *dev, char *buf)      \
 {                                                                      \
-       return show_temp(dev, buf, 0x##offset - 1);                     \
+       return show_temp(dev, buf, offset - 1);                         \
 }                                                                      \
 static ssize_t show_temp_##offset##_min (struct device *dev, char *buf)        \
 {                                                                      \
-       return show_temp_min(dev, buf, 0x##offset - 1);                 \
+       return show_temp_min(dev, buf, offset - 1);                     \
 }                                                                      \
 static ssize_t show_temp_##offset##_max (struct device *dev, char *buf)        \
 {                                                                      \
-       return show_temp_max(dev, buf, 0x##offset - 1);                 \
+       return show_temp_max(dev, buf, offset - 1);                     \
 }                                                                      \
 static ssize_t set_temp_##offset##_min (struct device *dev,            \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_temp_min(dev, buf, count, 0x##offset - 1);           \
+       return set_temp_min(dev, buf, count, offset - 1);               \
 }                                                                      \
 static ssize_t set_temp_##offset##_max (struct device *dev,            \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_temp_max(dev, buf, count, 0x##offset - 1);           \
+       return set_temp_max(dev, buf, count, offset - 1);               \
 }                                                                      \
 static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL);   \
 static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR,              \
index 304451cd6283086b4a06fdf2d24e1d056d1c0f6b..b534867f04ffb8c654130d2fae7a7143c28125b4 100644 (file)
@@ -298,43 +298,43 @@ static ssize_t set_pwm_en(struct device *dev, const char *buf,
 #define fan_present(offset)                                            \
 static ssize_t get_fan##offset (struct device *dev, char *buf)         \
 {                                                                      \
-       return get_fan(dev, buf, 0x##offset - 1);                       \
+       return get_fan(dev, buf, offset - 1);                           \
 }                                                                      \
 static ssize_t get_fan##offset##_min (struct device *dev, char *buf)   \
 {                                                                      \
-       return get_fan_min(dev, buf, 0x##offset - 1);                   \
+       return get_fan_min(dev, buf, offset - 1);                       \
 }                                                                      \
 static ssize_t set_fan##offset##_min (struct device *dev,              \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_fan_min(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_min(dev, buf, count, offset - 1);                \
 }                                                                      \
 static ssize_t get_fan##offset##_div (struct device *dev, char *buf)   \
 {                                                                      \
-       return get_fan_div(dev, buf, 0x##offset - 1);                   \
+       return get_fan_div(dev, buf, offset - 1);                       \
 }                                                                      \
 static ssize_t set_fan##offset##_div (struct device *dev,              \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_fan_div(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_div(dev, buf, count, offset - 1);                \
 }                                                                      \
 static ssize_t get_pwm##offset (struct device *dev, char *buf)         \
 {                                                                      \
-       return get_pwm(dev, buf, 0x##offset - 1);                       \
+       return get_pwm(dev, buf, offset - 1);                           \
 }                                                                      \
 static ssize_t set_pwm##offset (struct device *dev,                    \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_pwm(dev, buf, count, 0x##offset - 1);                \
+       return set_pwm(dev, buf, count, offset - 1);                    \
 }                                                                      \
 static ssize_t get_pwm##offset##_en (struct device *dev, char *buf)    \
 {                                                                      \
-       return get_pwm_en(dev, buf, 0x##offset - 1);                    \
+       return get_pwm_en(dev, buf, offset - 1);                        \
 }                                                                      \
 static ssize_t set_pwm##offset##_en (struct device *dev,               \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_pwm_en(dev, buf, count, 0x##offset - 1);             \
+       return set_pwm_en(dev, buf, count, offset - 1);                 \
 }                                                                      \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, get_fan##offset,      \
                NULL);                                                  \
index 851c5b260cf11c79b9f754da2f1355a04c52ac19..e9e0ad39c9894a86a9c28464c595538e26c624bc 100644 (file)
@@ -383,27 +383,27 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
 static ssize_t                                                         \
        show_in##offset (struct device *dev, char *buf)         \
 {                                                              \
-       return show_in(dev, buf, 0x##offset);                   \
+       return show_in(dev, buf, offset);                       \
 }                                                              \
 static ssize_t                                                         \
        show_in##offset##_min (struct device *dev, char *buf)   \
 {                                                              \
-       return show_in_min(dev, buf, 0x##offset);               \
+       return show_in_min(dev, buf, offset);           \
 }                                                              \
 static ssize_t                                                         \
        show_in##offset##_max (struct device *dev, char *buf)   \
 {                                                              \
-       return show_in_max(dev, buf, 0x##offset);               \
+       return show_in_max(dev, buf, offset);           \
 }                                                              \
 static ssize_t set_in##offset##_min (struct device *dev,       \
                const char *buf, size_t count)                  \
 {                                                              \
-       return set_in_min(dev, buf, count, 0x##offset);         \
+       return set_in_min(dev, buf, count, offset);             \
 }                                                              \
 static ssize_t set_in##offset##_max (struct device *dev,       \
                        const char *buf, size_t count)          \
 {                                                              \
-       return set_in_max(dev, buf, count, 0x##offset);         \
+       return set_in_max(dev, buf, count, offset);             \
 }                                                              \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);\
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,        \
@@ -451,27 +451,27 @@ static ssize_t set_temp_hyst(struct device *dev, const char *buf,
 #define show_temp_offset(offset)                                       \
 static ssize_t show_temp_##offset (struct device *dev, char *buf)      \
 {                                                                      \
-       return show_temp(dev, buf, 0x##offset - 1);                     \
+       return show_temp(dev, buf, offset - 1);                         \
 }                                                                      \
 static ssize_t                                                         \
 show_temp_##offset##_over (struct device *dev, char *buf)              \
 {                                                                      \
-       return show_temp_over(dev, buf, 0x##offset - 1);                        \
+       return show_temp_over(dev, buf, offset - 1);                    \
 }                                                                      \
 static ssize_t                                                         \
 show_temp_##offset##_hyst (struct device *dev, char *buf)              \
 {                                                                      \
-       return show_temp_hyst(dev, buf, 0x##offset - 1);                        \
+       return show_temp_hyst(dev, buf, offset - 1);                    \
 }                                                                      \
 static ssize_t set_temp_##offset##_over (struct device *dev,           \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_temp_over(dev, buf, count, 0x##offset - 1);          \
+       return set_temp_over(dev, buf, count, offset - 1);              \
 }                                                                      \
 static ssize_t set_temp_##offset##_hyst (struct device *dev,           \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_temp_hyst(dev, buf, count, 0x##offset - 1);          \
+       return set_temp_hyst(dev, buf, count, offset - 1);              \
 }                                                                      \
 static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL);\
 static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR,              \
@@ -522,25 +522,25 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
 #define show_fan_offset(offset)                                                \
 static ssize_t show_fan_##offset (struct device *dev, char *buf)       \
 {                                                                      \
-       return show_fan(dev, buf, 0x##offset - 1);                      \
+       return show_fan(dev, buf, offset - 1);                          \
 }                                                                      \
 static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \
 {                                                                      \
-       return show_fan_min(dev, buf, 0x##offset - 1);                  \
+       return show_fan_min(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \
 {                                                                      \
-       return show_fan_div(dev, buf, 0x##offset - 1);                  \
+       return show_fan_div(dev, buf, offset - 1);                      \
 }                                                                      \
 static ssize_t set_fan_##offset##_min (struct device *dev,             \
        const char *buf, size_t count)                                  \
 {                                                                      \
-       return set_fan_min(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_min(dev, buf, count, offset - 1);                \
 }                                                                      \
 static ssize_t set_fan_##offset##_div (struct device *dev,             \
                const char *buf, size_t count)                          \
 {                                                                      \
-       return set_fan_div(dev, buf, count, 0x##offset - 1);            \
+       return set_fan_div(dev, buf, count, offset - 1);                \
 }                                                                      \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR,               \
index 18834101b1129efdd92735b660abb473d53cba23..4bb7aa958240c112b84c3720176e1144c2dcb985 100644 (file)
@@ -369,20 +369,20 @@ store_in_reg(MAX, max)
 static ssize_t \
 show_regs_in_##offset (struct device *dev, char *buf) \
 { \
-        return show_in(dev, buf, 0x##offset); \
+        return show_in(dev, buf, offset); \
 } \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
 
 #define sysfs_in_reg_offset(reg, offset) \
 static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \
 { \
-       return show_in_##reg (dev, buf, 0x##offset); \
+       return show_in_##reg (dev, buf, offset); \
 } \
 static ssize_t \
 store_regs_in_##reg##offset (struct device *dev, \
                            const char *buf, size_t count) \
 { \
-       return store_in_##reg (dev, buf, count, 0x##offset); \
+       return store_in_##reg (dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, \
                  show_regs_in_##reg##offset, store_regs_in_##reg##offset);
@@ -521,19 +521,19 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
 #define sysfs_fan_offset(offset) \
 static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \
 { \
-       return show_fan(dev, buf, 0x##offset); \
+       return show_fan(dev, buf, offset); \
 } \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
 
 #define sysfs_fan_min_offset(offset) \
 static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \
 { \
-       return show_fan_min(dev, buf, 0x##offset); \
+       return show_fan_min(dev, buf, offset); \
 } \
 static ssize_t \
 store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \
 { \
-       return store_fan_min(dev, buf, count, 0x##offset); \
+       return store_fan_min(dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
                  show_regs_fan_min##offset, store_regs_fan_min##offset);
@@ -595,20 +595,20 @@ store_temp_reg(HYST, max_hyst);
 static ssize_t \
 show_regs_temp_##offset (struct device *dev, char *buf) \
 { \
-       return show_temp(dev, buf, 0x##offset); \
+       return show_temp(dev, buf, offset); \
 } \
 static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
 
 #define sysfs_temp_reg_offset(reg, offset) \
 static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \
 { \
-       return show_temp_##reg (dev, buf, 0x##offset); \
+       return show_temp_##reg (dev, buf, offset); \
 } \
 static ssize_t \
 store_regs_temp_##reg##offset (struct device *dev, \
                              const char *buf, size_t count) \
 { \
-       return store_temp_##reg (dev, buf, count, 0x##offset); \
+       return store_temp_##reg (dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, \
                  show_regs_temp_##reg##offset, store_regs_temp_##reg##offset);
index ea8229e01c6b47604ed478103a3e77a3971a5130..98aa8de32dadb16b301f4aa6085665735f747211 100644 (file)
@@ -318,18 +318,18 @@ store_in_reg(MAX, max);
 static ssize_t \
 show_regs_in_##offset (struct device *dev, char *buf) \
 { \
-        return show_in(dev, buf, 0x##offset); \
+        return show_in(dev, buf, offset); \
 } \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
 
 #define sysfs_in_reg_offset(reg, offset) \
 static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \
 { \
-       return show_in_##reg (dev, buf, 0x##offset); \
+       return show_in_##reg (dev, buf, offset); \
 } \
 static ssize_t store_regs_in_##reg##offset (struct device *dev, const char *buf, size_t count) \
 { \
-       return store_in_##reg (dev, buf, count, 0x##offset); \
+       return store_in_##reg (dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_in_##reg##offset, store_regs_in_##reg##offset);
 
@@ -384,18 +384,18 @@ store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
 #define sysfs_fan_offset(offset) \
 static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \
 { \
-       return show_fan(dev, buf, 0x##offset); \
+       return show_fan(dev, buf, offset); \
 } \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
 
 #define sysfs_fan_min_offset(offset) \
 static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \
 { \
-       return show_fan_min(dev, buf, 0x##offset); \
+       return show_fan_min(dev, buf, offset); \
 } \
 static ssize_t store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \
 { \
-       return store_fan_min(dev, buf, count, 0x##offset); \
+       return store_fan_min(dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, show_regs_fan_min##offset, store_regs_fan_min##offset);
 
@@ -464,18 +464,18 @@ store_temp_reg(HYST, max_hyst);
 static ssize_t \
 show_regs_temp_##offset (struct device *dev, char *buf) \
 { \
-       return show_temp(dev, buf, 0x##offset); \
+       return show_temp(dev, buf, offset); \
 } \
 static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
 
 #define sysfs_temp_reg_offset(reg, offset) \
 static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \
 { \
-       return show_temp_##reg (dev, buf, 0x##offset); \
+       return show_temp_##reg (dev, buf, offset); \
 } \
 static ssize_t store_regs_temp_##reg##offset (struct device *dev, const char *buf, size_t count) \
 { \
-       return store_temp_##reg (dev, buf, count, 0x##offset); \
+       return store_temp_##reg (dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_temp_##reg##offset, store_regs_temp_##reg##offset);