Fix IN_FROM_REG rounding.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2124 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2003-11-30 11:40:20 +00:00
1 parent c1e28f8896
commit a3c77b0191
5 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -137,12 +137,12 @@ static int init = 1;
#define THERMISTOR 2
#define PIIDIODE 3
/* Conversions. Rounding and limit checking is only done on the TO_REG
/* Conversions. Limit checking is only done on the TO_REG
variants. Note that you should be a bit careful with which arguments
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 + 8)/16),0,255))
#define IN_FROM_REG(val) (((val) * 16) / 10)
#define IN_FROM_REG(val) (((val) * 16 + 5) / 10)
static inline u8 FAN_TO_REG(long rpm, int div)
{