Skip to contentSkip to conversation

Fix voltage rounding in lm80

PATCH New Jean Delvare 2 participants 2 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix voltage rounding in lm80

Hi Greg,

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

Please apply,
thanks.

drivers/i2c/chips/lm80.c renamed from drivers/i2c/chips/lm80.c.orig +1 -1
@@ -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)
Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
Applied
#1 lore raw

PATCH 1/1 Fix voltage rounding in lm80

Quoted 3 lines · Jean Delvare

Hi Greg,

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

Applied, thanks.

greg k-h