From 5f12c19908dad6f259b253204bf549267962db7f Mon Sep 17 00:00:00 2001 From: Ivan Khoronzhuk Date: Thu, 17 Sep 2015 11:31:29 +0300 Subject: linux-generic: odp_time: reutrn 0 if t2 = t1 for diff When times are equal the difference should be 0. Currently it's equal to UINT64_MAX and doesn't allow to compare ranges beginning from start time. The validation test to check it will be added later. Signed-off-by: Ivan Khoronzhuk Reviewed-by: Petri Savolainen Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/linux-generic/odp_time.c') diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index a08833d..a007d69 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -14,7 +14,7 @@ uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2) { - if (odp_likely(t2 > t1)) + if (odp_likely(t2 >= t1)) return t2 - t1; return t2 + (UINT64_MAX - t1); -- cgit v1.2.3