qcacmn: Create qdf_log_timestamp_to_secs helper function
Create a timestamp conversion helper that returns whole seconds and
remaining micro seconds, for easier consumption by logging methods.
Change-Id: I5bc40075566485f3dc9f7e5fd81a13ec462c5da0
CRs-Fixed: 2031564
diff --git a/wmi_unified.c b/wmi_unified.c
index 73b9d7a..7ac4b75 100644
--- a/wmi_unified.c
+++ b/wmi_unified.c
@@ -588,13 +588,14 @@
while (count) {
struct wmi_command_debug *cmd_log = (struct wmi_command_debug *)
&((struct wmi_command_debug *)log_buffer->buf)[idx];
- long long us = qdf_log_timestamp_to_usecs(cmd_log->time);
+ uint64_t secs, usecs;
int len = 0;
int i;
+ qdf_log_timestamp_to_secs(cmd_log->time, &secs, &usecs);
len += scnprintf(str + len, sizeof(str) - len,
"% 8lld.%06lld %6u (0x%06x) ",
- us / 1000000, us % 1000000,
+ secs, usecs,
cmd_log->command, cmd_log->command);
for (i = 0; i < data_len; ++i) {
len += scnprintf(str + len, sizeof(str) - len,
@@ -641,13 +642,14 @@
while (count) {
struct wmi_event_debug *event_log = (struct wmi_event_debug *)
&((struct wmi_event_debug *)log_buffer->buf)[idx];
- long long us = qdf_log_timestamp_to_usecs(event_log->time);
+ uint64_t secs, usecs;
int len = 0;
int i;
+ qdf_log_timestamp_to_secs(event_log->time, &secs, &usecs);
len += scnprintf(str + len, sizeof(str) - len,
"% 8lld.%06lld %6u (0x%06x) ",
- us / 1000000, us % 1000000,
+ secs, usecs,
event_log->event, event_log->event);
for (i = 0; i < data_len; ++i) {
len += scnprintf(str + len, sizeof(str) - len,