summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2021-09-24 12:30:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-06 15:42:33 +0200
commitc37d3287e7a268c870e47e72a8cbeb90811e173c (patch)
tree3f5aa98cdfa4bdef1aee9d8e214bfec1395f6a5c /include/net
parent8a07d5aba34b443ae5ff3fb04d87a0ca05efa03c (diff)
hwmon: (tmp421) fix rounding for negative values
[ Upstream commit 724e8af85854c4d3401313b6dd7d79cf792d8990 ] Old code produces -24999 for 0b1110011100000000 input in standard format due to always rounding up rather than "away from zero". Use the common macro for division, unify and simplify the conversion code along the way. Fixes: 9410700b881f ("hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chips") Signed-off-by: Paul Fertser <fercerpav@gmail.com> Link: https://lore.kernel.org/r/20210924093011.26083-3-fercerpav@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/net')
0 files changed, 0 insertions, 0 deletions