From patchwork Thu Sep 17 08:31:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 53778 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id E070E22E57 for ; Thu, 17 Sep 2015 08:34:22 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf3665407lbc.1 for ; Thu, 17 Sep 2015 01:34:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=WYSOAKFwLmJ4zbNwOwcAVltjLAbhmjmd/wphRpD4K58=; b=XpmYQBB/ToZvVtEjq0F+Y8wGhTl3HFPJ22i2tqZBHIKesLN1s2VrVK37crvRAVNgs7 Bt4OpxprOXkVpCJuHI8NNe9clppLWtpBjn272HVFtFZGvYwxOzUV5vZCMbOrzXDVGubo H2YyxLCfib8AfDgZhboCCKggDFjTbQia2nZa/ojMK0FR6TRLejw8Ga5ijJ1pkylJcUfR hoPkNPc48elLJ6Rwxk7j5TVNYh4xVnSzHUZlSlDrXFvXnpre2wGBPD2m+k9udYJfakR2 BLWuH5o6ydi11NLTzYmttcd6DbgiIb6JRozazIN9kpCMUL0VAwTarqZYCTofO053UX1G DXCQ== X-Gm-Message-State: ALoCoQnThEDtmS7yR874zkOPrWxUmqh4oknYfwm8UUtUxrRJVrRvyVdDqTHqJwlueG6xNkykKGWl X-Received: by 10.180.8.135 with SMTP id r7mr507792wia.0.1442478861803; Thu, 17 Sep 2015 01:34:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.225 with SMTP id u1ls48867laa.83.gmail; Thu, 17 Sep 2015 01:34:21 -0700 (PDT) X-Received: by 10.152.163.98 with SMTP id yh2mr11705437lab.5.1442478861636; Thu, 17 Sep 2015 01:34:21 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id jb6si1369706lbc.40.2015.09.17.01.34.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 01:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbcao8 with SMTP id ao8so5418425lbc.3 for ; Thu, 17 Sep 2015 01:34:21 -0700 (PDT) X-Received: by 10.152.23.199 with SMTP id o7mr32284540laf.76.1442478861537; Thu, 17 Sep 2015 01:34:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2926437lbq; Thu, 17 Sep 2015 01:34:20 -0700 (PDT) X-Received: by 10.50.79.197 with SMTP id l5mr4054028igx.93.1442478860615; Thu, 17 Sep 2015 01:34:20 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e67si1537774iod.151.2015.09.17.01.34.20; Thu, 17 Sep 2015 01:34:20 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 1E18362D47; Thu, 17 Sep 2015 08:34:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 52B1E62D4C; Thu, 17 Sep 2015 08:32:30 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 2E1B162D4C; Thu, 17 Sep 2015 08:32:11 +0000 (UTC) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by lists.linaro.org (Postfix) with ESMTPS id BF41E62D25 for ; Thu, 17 Sep 2015 08:31:41 +0000 (UTC) Received: by wicfx3 with SMTP id fx3so13278457wic.1 for ; Thu, 17 Sep 2015 01:31:41 -0700 (PDT) X-Received: by 10.180.75.176 with SMTP id d16mr5456297wiw.75.1442478700962; Thu, 17 Sep 2015 01:31:40 -0700 (PDT) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id s16sm8743445wik.13.2015.09.17.01.31.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Sep 2015 01:31:40 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Thu, 17 Sep 2015 11:31:29 +0300 Message-Id: <1442478691-30098-4-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442478691-30098-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1442478691-30098-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v3 3/5] linux-generic: odp_time: reutrn 0 if t2 = t1 for diff X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ivan.khoronzhuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --- 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);