From patchwork Mon Aug 31 13:05:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 52891 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 6939822EC1 for ; Mon, 31 Aug 2015 13:08:18 +0000 (UTC) Received: by labd1 with SMTP id d1sf40046602lab.0 for ; Mon, 31 Aug 2015 06:08:17 -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=iVTB1VIZbwynlL+WKzNpOzgGc5rZNcXd8CIlwHWoLVM=; b=aj7Tg0brsV8Y3pLKSiRzZx9Pv35+oSM7hlzc4KfpLqPIEPfe/CnjCiqz4rjfR/fRvD swP7hAtAGzMJUpJVe69XpMZSDkLE767DRm5lcdpe6VGZMQzIosxikEr+VO960zvrRjNx 0bhveupfNd+ebGtSqXxaU6NAYbP6zvnUZDNSqwZWZw4ySUWPR+x/OePH4xDTGlc2k+gH xpCVnHfYhlaqT0rYJFTC4UcwQYswMMuUyEaHpXxKXhVKcgDM9aQVSkQxGjwcmjzoBVjg yAqKnnNFH2IOUetIEohDJkcCz0wzk0NgSOqDJocoM6YfQw9Qgtu8uZmKWX3/NxmJKqWS Xybg== X-Gm-Message-State: ALoCoQmtg3MtOp7GslmqzYXQwnlkwxfyBIITbYa7Nujr0/Xcyx4M9Tp6LqGyKvm4bJO59l9oyRKL X-Received: by 10.112.199.5 with SMTP id jg5mr6221595lbc.14.1441026497329; Mon, 31 Aug 2015 06:08:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.39 with SMTP id p7ls427232lap.104.gmail; Mon, 31 Aug 2015 06:08:17 -0700 (PDT) X-Received: by 10.152.203.134 with SMTP id kq6mr10489863lac.106.1441026497195; Mon, 31 Aug 2015 06:08:17 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id 2si13118784lap.83.2015.08.31.06.08.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Aug 2015 06:08:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laboe4 with SMTP id oe4so44469012lab.0 for ; Mon, 31 Aug 2015 06:08:17 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr11005524laf.32.1441026497086; Mon, 31 Aug 2015 06:08:17 -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.151.194 with SMTP id us2csp1625911lbb; Mon, 31 Aug 2015 06:08:16 -0700 (PDT) X-Received: by 10.55.42.65 with SMTP id q62mr8866209qkh.12.1441026496033; Mon, 31 Aug 2015 06:08:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id v88si16950682qkv.71.2015.08.31.06.08.14; Mon, 31 Aug 2015 06:08:16 -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 CABAB61C9E; Mon, 31 Aug 2015 13:08:14 +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 00D6161CB8; Mon, 31 Aug 2015 13:06:49 +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 36C5261970; Mon, 31 Aug 2015 13:06:16 +0000 (UTC) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by lists.linaro.org (Postfix) with ESMTPS id 66F3D61975 for ; Mon, 31 Aug 2015 13:06:13 +0000 (UTC) Received: by widfa3 with SMTP id fa3so24487018wid.1 for ; Mon, 31 Aug 2015 06:06:12 -0700 (PDT) X-Received: by 10.194.109.97 with SMTP id hr1mr27770762wjb.38.1441026371387; Mon, 31 Aug 2015 06:06:11 -0700 (PDT) Received: from khorivan.synapse.com ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id ne7sm17955341wic.12.2015.08.31.06.06.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Aug 2015 06:06:10 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Mon, 31 Aug 2015 16:05:49 +0300 Message-Id: <1441026351-5378-3-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441026351-5378-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1441026351-5378-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Topics: patch Subject: [lng-odp] [odp-lng] [Patch 2/4] linux-generic: odp_time: reutrn 0 if t2 = t1 instead of MAX 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.215.44 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 It's better to describe by example: cur = 15; start = 15; diff = 2; while (odp_time_cycles_diff(start, cur) < diff) { cur = odp_time_cycles(); } This example has to work. It's possible only when t2 - t1 = 0 if t2 = t1. The validation test on 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 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);