hwmon: (sis5595) Prevent overflow problem when writing large limits
authorAxel Lin <axel.lin@ingics.com>
Thu, 31 Jul 2014 14:27:04 +0000 (22:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Sep 2014 23:28:35 +0000 (16:28 -0700)
commit5fafb69d9854a1b38ff0fe1b0058544b94702871
tree63a050bc1e83025435030724b0d8875e0b054c3e
parent61d2b2bea78efae53eee7d47c20a0637a1099c26
hwmon: (sis5595) Prevent overflow problem when writing large limits

commit cc336546ddca8c22de83720632431c16a5f9fe9a upstream.

On platforms with sizeof(int) < sizeof(long), writing a temperature
limit larger than MAXINT will result in unpredictable limit values
written to the chip. Avoid auto-conversion from long to int to fix
the problem.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/sis5595.c