Skip to content

Commit

Permalink
Revert "ktime: Simplify ktime_compare implementation"
Browse files Browse the repository at this point in the history
Thierry bisected boot failures to this simplification commit.

Reverts: 3f1d472 ("ktime: Simplify ktime_compare implementation")
Reported-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mariusz Skamra <mariuszx.skamra@intel.com>
  • Loading branch information
Thomas Gleixner committed Jun 26, 2017
1 parent b7dcc4e commit 9902747
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/linux/ktime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 9902747

Please sign in to comment.