aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/f71805f.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/f71805f.c')
-rw-r--r--drivers/hwmon/f71805f.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hwmon/f71805f.c b/drivers/hwmon/f71805f.c
index 92f949767ece..6dbfd3e516e4 100644
--- a/drivers/hwmon/f71805f.c
+++ b/drivers/hwmon/f71805f.c
@@ -283,11 +283,11 @@ static inline long temp_from_reg(u8 reg)
283 283
284static inline u8 temp_to_reg(long val) 284static inline u8 temp_to_reg(long val)
285{ 285{
286 if (val < 0) 286 if (val <= 0)
287 val = 0; 287 return 0;
288 else if (val > 1000 * 0xff) 288 if (val >= 1000 * 0xff)
289 val = 0xff; 289 return 0xff;
290 return ((val + 500) / 1000); 290 return (val + 500) / 1000;
291} 291}
292 292
293/* 293/*