aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-01-07 10:37:31 -0500
committerJean Delvare <khali@linux-fr.org>2009-01-07 10:37:31 -0500
commit2f650631b3710622666367474b5475ff81ba486e (patch)
treeea98ba22d898179d8c8e75ea3344bbdf9fc75022 /drivers/hwmon
parent28ba858798d5c70513cd8b9742841fd1bd49a074 (diff)
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 <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/f71882fg.c4
1 files changed, 2 insertions, 2 deletions
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)
810 outb(SIO_LOCK_KEY, base); 810 outb(SIO_LOCK_KEY, base);
811} 811}
812 812
813static inline u16 fan_from_reg(u16 reg) 813static inline int fan_from_reg(u16 reg)
814{ 814{
815 return reg ? (1500000 / reg) : 0; 815 return reg ? (1500000 / reg) : 0;
816} 816}
817 817
818static inline u16 fan_to_reg(u16 fan) 818static inline u16 fan_to_reg(int fan)
819{ 819{
820 return fan ? (1500000 / fan) : 0; 820 return fan ? (1500000 / fan) : 0;
821} 821}