aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/via686a.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-05-16 12:52:38 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-22 00:51:57 -0400
commit68188ba7de2db9999ff08a4544a78b2f10eb08bd (patch)
tree37e0406d7f2b6ace2bc73043bda0c745d3aa5e37 /drivers/i2c/chips/via686a.c
parentff3240946d6a3d9f2ecf273f7330e09eec5484eb (diff)
[PATCH] I2C: Kill common macro abuse in chip drivers
This patch kills a common macro abuse in i2c chip drivers: defining ALARMS_FROM_REG returning its argument unchanged. Dropping the macro makes the code somewhat more readable IMHO. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips/via686a.c')
-rw-r--r--drivers/i2c/chips/via686a.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
index e7a686267942..3140ae8882a9 100644
--- a/drivers/i2c/chips/via686a.c
+++ b/drivers/i2c/chips/via686a.c
@@ -292,8 +292,6 @@ static inline long TEMP_FROM_REG10(u16 val)
292 tempLUT[eightBits + 1] * twoBits) * 25; 292 tempLUT[eightBits + 1] * twoBits) * 25;
293} 293}
294 294
295#define ALARMS_FROM_REG(val) (val)
296
297#define DIV_FROM_REG(val) (1 << (val)) 295#define DIV_FROM_REG(val) (1 << (val))
298#define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1) 296#define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1)
299 297
@@ -570,7 +568,7 @@ show_fan_offset(2);
570/* Alarms */ 568/* Alarms */
571static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) { 569static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) {
572 struct via686a_data *data = via686a_update_device(dev); 570 struct via686a_data *data = via686a_update_device(dev);
573 return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); 571 return sprintf(buf, "%u\n", data->alarms);
574} 572}
575static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 573static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
576 574