diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-05-16 18:52:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-21 21:51:57 -0700 |
commit | 68188ba7de2db9999ff08a4544a78b2f10eb08bd (patch) | |
tree | 37e0406d7f2b6ace2bc73043bda0c745d3aa5e37 /drivers/i2c/chips/it87.c | |
parent | ff3240946d6a3d9f2ecf273f7330e09eec5484eb (diff) | |
download | lwn-68188ba7de2db9999ff08a4544a78b2f10eb08bd.tar.gz lwn-68188ba7de2db9999ff08a4544a78b2f10eb08bd.zip |
[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/it87.c')
-rw-r--r-- | drivers/i2c/chips/it87.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c index 16dbfd8dac1b..7984bf920d31 100644 --- a/drivers/i2c/chips/it87.c +++ b/drivers/i2c/chips/it87.c @@ -172,8 +172,6 @@ static inline u8 FAN_TO_REG(long rpm, int div) ((val)+500)/1000),-128,127)) #define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*1000) -#define ALARMS_FROM_REG(val) (val) - #define PWM_TO_REG(val) ((val) >> 1) #define PWM_FROM_REG(val) (((val)&0x7f) << 1) @@ -665,7 +663,7 @@ show_pwm_offset(3); static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) { struct it87_data *data = it87_update_device(dev); - return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); + return sprintf(buf, "%u\n", data->alarms); } static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |