projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e707eb7
)
ktime: Simplify ktime_compare implementation
author
Mariusz Skamra
<mariuszx.skamra@intel.com>
Fri, 26 May 2017 13:00:47 +0000
(15:00 +0200)
committer
Thomas Gleixner
<tglx@linutronix.de>
Tue, 20 Jun 2017 19:33:55 +0000
(21:33 +0200)
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
include/linux/ktime.h
patch
|
blob
|
blame
|
history
diff --git
a/include/linux/ktime.h
b/include/linux/ktime.h
index 0c8bd45c820615eeaa3d50370f598c7f567ce51d..04817b1ca0195afa4f4cff4888c1267e60ed9e18 100644
(file)
--- 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);
}
/**