Commit 3f1d4720 authored by Mariusz Skamra's avatar Mariusz Skamra Committed by Thomas Gleixner

ktime: Simplify ktime_compare implementation

ktime_sub can be used here instread of two conditional checks.
Signed-off-by: default avatarMariusz Skamra <mariuszx.skamra@intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@intel.com>
Link: http://lkml.kernel.org/r/1495803647-9504-1-git-send-email-mariuszx.skamra@intel.com
parent e707eb76
......@@ -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);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment