]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (smsc47m192) Fix temperature limit and vrm write operations
authorGuenter Roeck <linux@roeck-us.net>
Fri, 18 Jul 2014 14:31:18 +0000 (07:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jul 2014 19:44:08 +0000 (12:44 -0700)
commit43b200edbdbc1268c3a9c005ed37366b40db7be6
tree692b17e58e17ad9f8bea77fa81138882adc6a82d
parenteeb295327b749ccc1f807e839a7d0e87129f5c84
hwmon: (smsc47m192) Fix temperature limit and vrm write operations

commit 043572d5444116b9d9ad8ae763cf069e7accbc30 upstream.

Temperature limit clamps are applied after converting the temperature
from milli-degrees C to degrees C, so either the clamp limit needs
to be specified in degrees C, not milli-degrees C, or clamping must
happen before converting to degrees C. Use the latter method to avoid
overflows.

vrm is an u8, so the written value needs to be limited to [0, 255].

Cc: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/smsc47m192.c