Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 40ebdb92 authored by Guenter Roeck's avatar Guenter Roeck
Browse files

hwmon: (w83791d) Fix smatch warning



smatch complains as follows when checking w83791d.c.

drivers/hwmon/w83791d.c:996 store_temp23() warn:
	'32768' 32768 can't fit into 32767 'data->temp_add[nr][index]'

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: default avatarGuenter Roeck <linux@roeck-us.net>
parent 7560dc0a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment