• G
    hwmon: (lm63) Fix smatch warnings · 7560dc0a
    Guenter Roeck 提交于
    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: NGuenter Roeck <linux@roeck-us.net>
    7560dc0a
lm63.c 36.0 KB