]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ips: fix firmware timestamps for 32-bit
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Apr 2018 16:04:40 +0000 (18:04 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Apr 2018 23:40:17 +0000 (19:40 -0400)
commitb806bdf6f22b94b2cc003746b9f075017efe43f3
tree663a1c2be7062ed95a7abc3480706912d228c88a
parent964d029ce42c363a4011e45f6cd7d4176a9da186
scsi: ips: fix firmware timestamps for 32-bit

do_gettimeofday() is deprecated since it will stop working in 2038 on
32-bit platforms, leading to incorrect times passed to the firmware.
On 64-bit platforms the current code appears to be fine, as the
calculation passes an 8-bit century number into the firmware that can
represent times long in the future (possibly until 25599).

Using ktime_get_real_seconds() to get a 64-bit seconds value and
time64_to_tm() to convert it into the firmware format greatly simplifies
the ips timekeeping code, makes 32-bit and 64-bit behave the same way
here, and gets us closer to removing the deprecated interfaces.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ips.c
drivers/scsi/ips.h