]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: esas2r: use ktime_get_real_seconds()
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Apr 2018 16:02:09 +0000 (18:02 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Apr 2018 23:40:16 +0000 (19:40 -0400)
commit964d029ce42c363a4011e45f6cd7d4176a9da186
tree5102d3cd2b81e0952564dc94de23fa408d3069df
parent76b6ec954c7c1df7436159208c8273b9ef0ead8c
scsi: esas2r: use ktime_get_real_seconds()

do_gettimeofday() is deprecated because of the y2038 overflow.  Here, we
use the result to pass into a 32-bit field in the firmware, which still
risks an overflow, but if the firmware is written to expect unsigned
values, it can at least last until y2106, and there is not much we can
do about it.

This changes do_gettimeofday() to ktime_get_real_seconds(), which at
least simplifies the code a bit, and avoids the deprecated
interface. I'm adding a comment about the overflow to document what
happens.

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