Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-12-09 18:58:59 +0100
committerAdrian Bunk <bunk@kernel.org>2008-01-06 04:18:59 +0200
commit3528fed43621960e41fef18a2013dc05801ee707 (patch)
tree586fd1ef726109884a286518efc01cfb328d3b76
parentf28b4d6af82321ebddda7e40075f50075207fc09 (diff)
hwmon/lm87: Fix a division by zero
Missing parentheses in the definition of FAN_FROM_REG cause a division by zero for a specific register value. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <j.w.r.degoede@hhs.nl> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Adrian Bunk <bunk@kernel.org>
-rw-r--r--drivers/hwmon/lm87.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index 44f27a72eebd..711bb60ad4be 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -128,7 +128,7 @@ static u8 LM87_REG_TEMP_LOW[3] = { 0x3A, 0x38, 0x2C };
(((val) < 0 ? (val)-500 : (val)+500) / 1000))
#define FAN_FROM_REG(reg,div) ((reg) == 255 || (reg) == 0 ? 0 : \
- 1350000 + (reg)*(div) / 2) / ((reg)*(div))
+ (1350000 + (reg)*(div) / 2) / ((reg)*(div)))
#define FAN_TO_REG(val,div) ((val)*(div) * 255 <= 1350000 ? 255 : \
(1350000 + (val)*(div) / 2) / ((val)*(div)))