From a1f3219ff5c83c599f717788391eba30aa077e86 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 3 Oct 2016 22:00:52 +0000 Subject: [PATCH] scst/include/backport.h: Fix RHEL/CentOS 7 build RHEL 7 and CentOS 7 provide a definition of ktime_before(). Hence hide the ktime_before() definition on these Linux distro's. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6986 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index eec927283..98b21fd60 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -348,6 +348,24 @@ static inline int __must_check kref_get_unless_zero(struct kref *kref) } #endif +/* */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) +/** + * ktime_before - Compare if a ktime_t value is smaller than another one. + * @cmp1: comparable1 + * @cmp2: comparable2 + * + * Return: true if cmp1 happened before cmp2. + */ +static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) +{ + return ktime_compare(cmp1, cmp2) < 0; +} +#endif + /* */ #ifndef __list_for_each @@ -678,19 +696,4 @@ static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) } #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) && \ - (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) -/** - * ktime_before - Compare if a ktime_t value is smaller than another one. - * @cmp1: comparable1 - * @cmp2: comparable2 - * - * Return: true if cmp1 happened before cmp2. - */ -static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) -{ - return ktime_compare(cmp1, cmp2) < 0; -} -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) */ - #endif /* _SCST_BACKPORT_H_ */