diff mbox

[v3,3/5] linux-generic: odp_time: reutrn 0 if t2 = t1 for diff

Message ID 1442478691-30098-4-git-send-email-ivan.khoronzhuk@linaro.org
State Accepted
Commit 5f12c19908dad6f259b253204bf549267962db7f
Headers show

Commit Message

Ivan Khoronzhuk Sept. 17, 2015, 8:31 a.m. UTC
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.khoronzhuk@linaro.org>
---
 platform/linux-generic/odp_time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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);