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)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 24 Jul 2014 13:25:25 +0000 (06:25 -0700)
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>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>

No differences found