From 4274b0c2a7debabba05ae20bd57df65324487787 Mon Sep 17 00:00:00 2001 From: litong20 Date: Mon, 28 Jun 2021 10:34:05 +0800 Subject: [PATCH] Solve the problem of incompatible type 'struct timespec64' touchscreen_mmi_gesture.c:196:4: error: passing 'struct timespec' to parameter of incompatible type 'struct timespec64'. Change-Id: Iab92d18c89766cfe510957e33e9fcd35290becfe Reviewed-on: https://gerrit.mot.com/1993292 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- include/linux/mmi_kernel_common.h | 6 ++++++ include/linux/touchscreen_mmi.h | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/linux/mmi_kernel_common.h b/include/linux/mmi_kernel_common.h index 2645eaad5dbc..d0e2e930ad40 100644 --- a/include/linux/mmi_kernel_common.h +++ b/include/linux/mmi_kernel_common.h @@ -35,4 +35,10 @@ #define SIGINFO siginfo #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) +#define TIME_SPEC timespec64 +#else +#define TIME_SPEC timespec +#endif + #endif /*_MMI_KERNEL_COMMON_H*/ diff --git a/include/linux/touchscreen_mmi.h b/include/linux/touchscreen_mmi.h index ad1ee50608e8..ec16ace9616c 100644 --- a/include/linux/touchscreen_mmi.h +++ b/include/linux/touchscreen_mmi.h @@ -20,6 +20,7 @@ #include #include #include +#include #if defined(CONFIG_PANEL_NOTIFICATIONS) @@ -209,9 +210,9 @@ struct msm_drm_notifier *evdata = evd; \ #define NANO_TO_MSEC 1000000 static inline unsigned long long timediff_ms( - struct timespec64 start, struct timespec64 end) + struct TIME_SPEC start, struct TIME_SPEC end) { - struct timespec64 temp; + struct TIME_SPEC temp; if ((end.tv_nsec - start.tv_nsec) < 0) { temp.tv_sec = end.tv_sec - start.tv_sec - 1;