[PATCH 2.6] Fix voltage rounding in lm80

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg,

This one line patch fixes voltage rounding in the lm80 chip driver.

Please apply,
thanks.

--- linux-2.6.5-mm3/drivers/i2c/chips/lm80.c.orig	Sat Apr 10 10:33:01 2004
+++ linux-2.6.5-mm3/drivers/i2c/chips/lm80.c	Mon Apr 12 09:14:01 2004
@@ -68,7 +68,7 @@
    these macros are called: arguments may be evaluated more than once.
    Fixing this is just not worth it. */
 
-#define IN_TO_REG(val)		(SENSORS_LIMIT((val)/10,0,255))
+#define IN_TO_REG(val)		(SENSORS_LIMIT(((val)+5)/10,0,255))
 #define IN_FROM_REG(val)	((val)*10)
 
 static inline unsigned char FAN_TO_REG(unsigned rpm, unsigned div)


-- 
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux