From 1bb9daf94b9344684d3d5f196b5c9240f8454916 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 24 Jun 2018 05:02:51 +0200 Subject: compat: more robust ktime backport This is needed for frankenkernels, like android-common. --- src/compat/compat.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/compat') diff --git a/src/compat/compat.h b/src/compat/compat.h index d08557f..2c1b663 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -327,7 +327,7 @@ static inline int get_random_bytes_wait(void *buf, int nbytes) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(ISRHEL7) -#include +#include static inline u64 ktime_get_boot_ns(void) { return ktime_to_ns(ktime_get_boottime()); @@ -335,11 +335,16 @@ static inline u64 ktime_get_boot_ns(void) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) -#include -static inline u64 ktime_get_boot_fast_ns(void) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) +#include +#else +#include +#endif +static inline u64 __wgcompat_ktime_get_boot_fast_ns(void) { return ktime_get_boot_ns(); } +#define ktime_get_boot_fast_ns __wgcompat_ktime_get_boot_fast_ns #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) -- cgit v1.2.3-59-g8ed1b