summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/python_version.py
diff options
context:
space:
mode:
authorRidham Khurana <khurana.ridham222@gmail.com>2026-09-23 17:25:48 +0000
committerGuenter Roeck <linux@roeck-us.net>2026-09-24 16:24:34 -0700
commitf58c16056f8585ebafb0f1f5d90c23085443a4b9 (patch)
tree92b3c673113bf856bd044d987bbc48476896f577 /tools/lib/python/kdoc/python_version.py
parent08e6615c909b2504a5862764f3a7fca00c7ab066 (diff)
downloadlinux-next-f58c16056f8585ebafb0f1f5d90c23085443a4b9.tar.gz
linux-next-f58c16056f8585ebafb0f1f5d90c23085443a4b9.zip
hwmon: (lm95245) Fix negative temperature conversion
temp_from_reg_signed() uses only the high byte when the sign bit is set and drops the fractional bits in the low byte. Writing -500 to temp2_offset stores 0xff80 (-0.5 degrees C) in the offset registers, but reading temp2_offset back returns -1000. Negative temp1_input and temp2_input values are rounded down to the next whole degree the same way. The chip reports -0.125 degrees C as 0xffe0, which the driver returns as -1000. Treat the register pair as a single 16-bit two's complement value. Fixes: fffd80ccc1e6 ("hwmon: LM95245 driver") Cc: stable@vger.kernel.org Signed-off-by: Ridham Khurana <khurana.ridham222@gmail.com> Link: https://patch.msgid.link/20260923172551.1593798-1-khurana.ridham222@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions