From: Hans de Goede Date: Wed, 7 Jan 2009 15:37:31 +0000 (+0100) Subject: hwmon: (f71882fg) Fix fan_to/from_reg prototypes X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2f650631b3710622666367474b5475ff81ba486e;p=linux-beck.git hwmon: (f71882fg) Fix fan_to/from_reg prototypes The RPM after conversion from / before conversion to a register value can be much more than 65535 (up to 1500000), so putting this into an u16 can cause overflows. This changes the functions to use an int to store / get RPM instead. Signed-off-by: Hans de Goede Signed-off-by: Jean Delvare --- diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c index a6dc3c7787f7..d867b377d4e9 100644 --- a/drivers/hwmon/f71882fg.c +++ b/drivers/hwmon/f71882fg.c @@ -810,12 +810,12 @@ static inline void superio_exit(int base) outb(SIO_LOCK_KEY, base); } -static inline u16 fan_from_reg(u16 reg) +static inline int fan_from_reg(u16 reg) { return reg ? (1500000 / reg) : 0; } -static inline u16 fan_to_reg(u16 fan) +static inline u16 fan_to_reg(int fan) { return fan ? (1500000 / fan) : 0; }