From 9902747ec57d11b27c98e53d66112ecceed43c82 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 26 Jun 2017 10:24:27 +0200 Subject: Revert "ktime: Simplify ktime_compare implementation" Thierry bisected boot failures to this simplification commit. Reverts: 3f1d472055bb ("ktime: Simplify ktime_compare implementation") Reported-by: Thierry Reding Signed-off-by: Thomas Gleixner Cc: Mariusz Skamra --- include/linux/ktime.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 04817b1ca019..0c8bd45c8206 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -108,7 +108,11 @@ static inline ktime_t timeval_to_ktime(struct timeval tv) */ static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) { - return ktime_sub(cmp1, cmp2); + if (cmp1 < cmp2) + return -1; + if (cmp1 > cmp2) + return 1; + return 0; } /** -- cgit v1.2.3