]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: ds1307: ds3231 temperature s16 overflow
authorZhuang Yuyao <mlistz@gmail.com>
Mon, 18 Apr 2016 00:21:42 +0000 (09:21 +0900)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 21 Apr 2016 21:20:59 +0000 (23:20 +0200)
commit6b4dd0a7b75ed126abea48d90dbf3d1a348aabb8
tree18262d9099432d76b6598453783c69ea25d77c8a
parent7704e677625e6329134e533c6dfd7f046de3c48f
rtc: ds1307: ds3231 temperature s16 overflow

while retrieving temperature from ds3231, the result may be overflow
since s16 is too small for a multiplication with 250.

ie. if temp_buf[0] == 0x2d, the result (s16 temp) will be negative.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Tested-by: Michael Tatarinov <kukabu@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-ds1307.c