diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-11-10 18:37:09 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-12-05 04:32:52 +0300 |
commit | 7e75f6077074a7ce2c62092acbad0665ba88485d (patch) | |
tree | a24898962af80151791fa3f0238c0bba98a2dfe9 /drivers/scsi/bfa | |
parent | 2c7982364e05abaa709c0b69dd94c8b389f8ae13 (diff) | |
download | linux-7e75f6077074a7ce2c62092acbad0665ba88485d.tar.xz |
scsi: bfa: use ktime_get_real_ts64 for firmware timestamp
BFA_TRC_TS() calculates a 32-bit microsecond timestamp using the
deprecated do_gettimeofday() function. This overflows roughly every 71
minutes, so it's obviously not used as an absolute time stamp, but it
seems wrong to use a time base for it that will jump during
settimeofday() calls, leap seconds, or the y2038 overflow.
This converts it to ktime_get_ts64(), which has none of those problems
but is not synchronized to wall-clock time.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Anil Gurumurthy <Anil.Gurumurthy@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r-- | drivers/scsi/bfa/bfa_cs.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/bfa/bfa_cs.h b/drivers/scsi/bfa/bfa_cs.h index df6760ca0911..9685efc59b16 100644 --- a/drivers/scsi/bfa/bfa_cs.h +++ b/drivers/scsi/bfa/bfa_cs.h @@ -35,10 +35,10 @@ #define BFA_TRC_TS(_trcm) \ ({ \ - struct timeval tv; \ + struct timespec64 ts; \ \ - do_gettimeofday(&tv); \ - (tv.tv_sec*1000000+tv.tv_usec); \ + ktime_get_ts64(&ts); \ + (ts.tv_sec*1000000+ts.tv_nsec / 1000); \ }) #ifndef BFA_TRC_TS |