This is a note to let you know that I've just added the patch titled

    hwmon: (f71805f) Fix clamping of temperature limits

to the 3.0-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hwmon-f71805f-fix-clamping-of-temperature-limits.patch
and it can be found in the queue-3.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 86b2bbfdbd1fcc4a3aa62ccd3f245c40c5ad5b85 Mon Sep 17 00:00:00 2001
From: Jean Delvare <[email protected]>
Date: Fri, 20 Jan 2012 10:09:23 -0500
Subject: hwmon: (f71805f) Fix clamping of temperature limits

From: Jean Delvare <[email protected]>

commit 86b2bbfdbd1fcc4a3aa62ccd3f245c40c5ad5b85 upstream.

Properly clamp temperature limits set by the user. Without this fix,
attempts to write temperature limits above the maximum supported by
the chip (255 degrees Celsius) would arbitrarily and unexpectedly
result in the limit being set to 0 degree Celsius.

Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/hwmon/f71805f.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/hwmon/f71805f.c
+++ b/drivers/hwmon/f71805f.c
@@ -283,11 +283,11 @@ static inline long temp_from_reg(u8 reg)
 
 static inline u8 temp_to_reg(long val)
 {
-       if (val < 0)
-               val = 0;
-       else if (val > 1000 * 0xff)
-               val = 0xff;
-       return ((val + 500) / 1000);
+       if (val <= 0)
+               return 0;
+       if (val >= 1000 * 0xff)
+               return 0xff;
+       return (val + 500) / 1000;
 }
 
 /*


Patches currently in stable-queue which might be from [email protected] are

queue-3.0/hwmon-w83627ehf-disable-setting-dc-mode-for-pwm2-pwm3-on-nct6776f.patch
queue-3.0/hwmon-f71805f-fix-clamping-of-temperature-limits.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to