Colin Ian King 347876ad47 rtc: tx4939: avoid unintended sign extension on a 24 bit shift
The shifting of buf[5] by 24 bits to the left will be promoted to
a 32 bit signed int and then sign-extended to an unsigned long. If
the top bit of buf[5] is set then all then all the upper bits sec
end up as also being set because of the sign-extension. Fix this by
casting buf[5] to an unsigned long before the shift.

Detected by CoverityScan, CID#1465292 ("Unintended sign extension")

Fixes: 0e1492330cd2 ("rtc: add rtc-tx4939 driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-03-01 10:49:38 +01:00
..
2018-03-01 10:49:23 +01:00
2018-03-01 10:49:34 +01:00
2018-01-19 09:59:32 +01:00
2017-10-13 00:10:12 +02:00
2018-02-02 14:19:19 -08:00
2017-03-09 01:29:17 +01:00
2018-03-01 10:49:29 +01:00
2016-05-20 12:33:51 +02:00
2018-03-01 10:49:25 +01:00
2018-03-01 10:49:28 +01:00
2017-09-01 01:10:11 +02:00
2018-03-01 10:49:30 +01:00
2017-09-01 01:10:11 +02:00
2016-05-20 12:33:51 +02:00
2016-05-20 12:33:51 +02:00
2015-09-05 13:19:06 +02:00
2016-05-20 12:33:51 +02:00
2018-03-01 10:49:26 +01:00
2017-09-01 01:10:11 +02:00
2017-01-11 17:23:04 +01:00
2017-08-22 12:05:21 +02:00
2018-03-01 10:49:31 +01:00
2016-05-20 12:33:51 +02:00
2016-05-20 12:33:51 +02:00
2017-09-05 09:55:02 +02:00
2017-07-31 00:17:44 +02:00
2017-08-24 11:03:35 +02:00
2017-04-22 18:01:15 +02:00
2017-11-29 22:20:56 +01:00
2017-08-24 11:03:36 +02:00
2016-05-20 12:33:51 +02:00