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 <ivan.khoronz...@linaro.org>
---
 platform/linux-generic/odp_time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_time.c 
b/platform/linux-generic/odp_time.c
index 6e69e53..b378c35 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -20,7 +20,7 @@ uint64_t odp_time_cycles(void)
 
 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);
-- 
1.9.1

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to