diff options
author | Mariusz Skamra <mariuszx.skamra@intel.com> | 2017-05-26 15:00:47 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-06-20 21:33:55 +0200 |
commit | 3f1d472055bbe914c9e54715fdbf2272851e23ff (patch) | |
tree | 2869b0c24f7b54bddb577fd89428a2bbf9ed6d3a /include | |
parent | Merge branch 'clockevents/4.13' of https://git.linaro.org/people/daniel.lezca... (diff) | |
download | linux-3f1d472055bbe914c9e54715fdbf2272851e23ff.tar.xz linux-3f1d472055bbe914c9e54715fdbf2272851e23ff.zip |
ktime: Simplify ktime_compare implementation
ktime_sub can be used here instread of two conditional checks.
Signed-off-by: Mariusz Skamra <mariuszx.skamra@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@intel.com>
Link: http://lkml.kernel.org/r/1495803647-9504-1-git-send-email-mariuszx.skamra@intel.com
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ktime.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 0c8bd45c8206..04817b1ca019 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -108,11 +108,7 @@ static inline ktime_t timeval_to_ktime(struct timeval tv) */ static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) { - if (cmp1 < cmp2) - return -1; - if (cmp1 > cmp2) - return 1; - return 0; + return ktime_sub(cmp1, cmp2); } /** |