From 1740435d4987f07e83ab8b34267665eaec27ca91 Mon Sep 17 00:00:00 2001 From: bings Date: Fri, 17 Apr 2020 14:38:46 +0800 Subject: [PATCH] qcacmn: Use ktime_get_real_ts64 for kernel 3.17.0+ ktime_get_real_ts64 is defined from kernel 3.17.0. Use ktime_get_real_ts64 instead of ktime_get_ts from kernel 3.17.0. Change-Id: Ica72545fe5224966fbb350813bf3c2d849946dbc CRs-Fixed: 2666404 --- qdf/linux/src/i_qdf_time.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qdf/linux/src/i_qdf_time.h b/qdf/linux/src/i_qdf_time.h index 7bde392a1450..975380b33153 100644 --- a/qdf/linux/src/i_qdf_time.h +++ b/qdf/linux/src/i_qdf_time.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -288,6 +288,16 @@ static inline uint64_t __qdf_get_log_timestamp(void) * * Return: system tick for non MSM platfroms */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) +static inline uint64_t __qdf_get_log_timestamp(void) +{ + struct timespec64 ts; + + ktime_get_real_ts64(&ts); + + return ((uint64_t)ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); +} +#else static inline uint64_t __qdf_get_log_timestamp(void) { struct timespec ts; @@ -297,6 +307,7 @@ static inline uint64_t __qdf_get_log_timestamp(void) return ((uint64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); } #endif +#endif /** * __qdf_get_bootbased_boottime_ns() - Get the bootbased time in nanoseconds