summaryrefslogtreecommitdiff
path: root/dhd_debug.c
diff options
context:
space:
mode:
authorAhmed ElArabawy <arabawy@google.com>2020-10-02 09:14:55 -0700
committerAhmed ElArabawy <arabawy@google.com>2020-10-05 12:43:37 -0700
commit0c333cdabe7ead98712025f35c56dbe5ef52eeb7 (patch)
tree1b058119789b98e268372edc16bfd3f31a2f082d /dhd_debug.c
parent3e0cc29070b3fd9ad35345fdcd944ba29b73adee (diff)
downloadbcm4389-0c333cdabe7ead98712025f35c56dbe5ef52eeb7.tar.gz
Replace usage of timeval and timespec with timespec64
This commit replaces the use of the struct timeval and timespec with the timespec64. This is part of the effort to switch to kernel 5.9 Bug: 169622740 Test: Build successful in mainline kernel branch Change-Id: I114cf1bf3a6319af03a03fe567906cf3b5d7f019 Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
Diffstat (limited to 'dhd_debug.c')
-rw-r--r--dhd_debug.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/dhd_debug.c b/dhd_debug.c
index 02688aa..6c8e4a1 100644
--- a/dhd_debug.c
+++ b/dhd_debug.c
@@ -1455,16 +1455,16 @@ __dhd_dbg_pkt_hash(uintptr_t pkt, uint32 pktid)
(__pkt + __pktid * __pktid));
}
-#define __TIMESPEC_TO_US(ts) \
- (((uint32)(ts).tv_sec * USEC_PER_SEC) + ((ts).tv_nsec / NSEC_PER_USEC))
+#define __TIMESPEC64_TO_US(ts) \
+ (((ts).tv_sec * USEC_PER_SEC) + ((ts).tv_nsec / NSEC_PER_USEC))
uint32
__dhd_dbg_driver_ts_usec(void)
{
- struct timespec ts;
+ struct timespec64 ts;
- get_monotonic_boottime(&ts);
- return ((uint32)(__TIMESPEC_TO_US(ts)));
+ GET_MONOTONIC_BOOT_TIME(&ts);
+ return ((uint32)(__TIMESPEC64_TO_US(ts)));
}
wifi_tx_packet_fate
@@ -2911,17 +2911,17 @@ char*
dhd_dbg_get_system_timestamp(void)
{
static char timebuf[DEBUG_DUMP_TIME_BUF_LEN];
- struct timeval tv;
- unsigned long local_time;
+ struct timespec64 ts;
+ unsigned long long local_time;
struct rtc_time tm;
memset_s(timebuf, DEBUG_DUMP_TIME_BUF_LEN, 0, DEBUG_DUMP_TIME_BUF_LEN);
- do_gettimeofday(&tv);
- local_time = (u32)(tv.tv_sec - (sys_tz.tz_minuteswest * 60));
+ GET_TIME_OF_DAY(&ts);
+ local_time = (u64)(ts.tv_sec - (sys_tz.tz_minuteswest * 60));
rtc_time_to_tm(local_time, &tm);
scnprintf(timebuf, DEBUG_DUMP_TIME_BUF_LEN,
"%02d:%02d:%02d.%06lu",
- tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec);
+ tm.tm_hour, tm.tm_min, tm.tm_sec, ts.tv_nsec/NSEC_PER_USEC);
return timebuf;
}