]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (lm63) Fix smatch warnings
authorGuenter Roeck <linux@roeck-us.net>
Wed, 25 Jun 2014 15:08:35 +0000 (08:08 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 4 Aug 2014 14:01:36 +0000 (07:01 -0700)
commit33c252ee6c15d3864bd2d75925ef942545dcb643
treed634a14d17c21714da9d168fc3311f04dee58514
parent61cb0c56ddfdbe47e93e5e36f2a914290275a06b
hwmon: (lm63) Fix smatch warnings

smatch complains as follows when checking lm63.c.

drivers/hwmon/lm63.c:594 set_temp11() warn:
'65504' 65504 can't fit into 32767 'data->temp11[nr]'
drivers/hwmon/lm63.c:596 set_temp11() warn:
'32768' 32768 can't fit into 32767 'data->temp11[nr]'

Fix by using DIV_ROUND_CLOSEST and clamp_val to convert the values.
While we are at it, modify other macros as well for consistency and
to make the code easier to understand.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm63.c