提交 7e75f607 编写于 作者: A Arnd Bergmann 提交者: Martin K. Petersen

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: NArnd Bergmann <arnd@arndb.de>
Acked-by: NAnil Gurumurthy <Anil.Gurumurthy@cavium.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 2c798236
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册