mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
ktime: Simplify ktime_compare implementation
ktime_sub can be used here instread of two conditional checks. Signed-off-by: Mariusz Skamra <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Kuppuswamy Sathyanarayanan <[email protected]> Link: http://lkml.kernel.org/r/[email protected]
This commit is contained in:
1 parent
e707eb762c
commit
3f1d472055
1 file changed
+1
-5
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user