Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b965d4b7f614522170af6a7e450be0333792ccd2
Commit:     b965d4b7f614522170af6a7e450be0333792ccd2
Parent:     428a7039c5717695935b946af9413e59f68928a4
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Wed Sep 26 22:16:56 2007 +0200
Committer:  Mark M. Hoffman <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 22:56:31 2007 -0400

    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 <[EMAIL PROTECTED]>
    Acked-by: Hans de Goede <[EMAIL PROTECTED]>
    Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 drivers/hwmon/lm87.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index e60076e..ef8a9b2 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -129,7 +129,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)))
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to