From patchwork Mon Jun 6 19:28:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 69451 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1635223qgf; Mon, 6 Jun 2016 12:28:29 -0700 (PDT) X-Received: by 10.55.195.193 with SMTP id r62mr17067846qkl.23.1465241309846; Mon, 06 Jun 2016 12:28:29 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id z128si11892131qke.35.2016.06.06.12.28.29; Mon, 06 Jun 2016 12:28:29 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 36EFA650B5; Mon, 6 Jun 2016 19:28:29 +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 38BD966981; Mon, 6 Jun 2016 19:28:25 +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 A58BA67441; Mon, 6 Jun 2016 19:28:23 +0000 (UTC) Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com [209.85.215.53]) by lists.linaro.org (Postfix) with ESMTPS id 80438650B5 for ; Mon, 6 Jun 2016 19:28:22 +0000 (UTC) Received: by mail-lf0-f53.google.com with SMTP id j198so682447lfe.2 for ; Mon, 06 Jun 2016 12:28:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gsTdiFpPBs4kBkv1uOXE2MKjS5ShMesxLXWqf9hoH7s=; b=A37HVphwKkZiuEA/xoxt6uyPpnzG6mjCWKUc+nZduRgXzQcVLDyJmWzOVeRgByLZdm EonkWCqcixMU3K8ZzCzEg60lDxDAu5X1AbJAEHfUNHvInSFlt4bxnHF+vAor9GF/CKkA VGeMn+CxNABYd/JkzEERwpIAhY//e6XHnoA8NkXKCGgHEGLFXOeh1Zto1g1xJ4OV/nsp H754F0iPKLYDqAt/SbLHOptmyWN4+7+ZLEoFICo8VCS6kj4diwMk2Bhzm7O9rPDCMxhd Lfs8ZBZU58zeexflXg2jo9zGDKmqqkC5DmW++NTxSfyX5mDuDQZCSAcIl4FyOAn+iyRM 7nYw== X-Gm-Message-State: ALyK8tKrHMmXRPZiR10R/kzS547lHe3REWlewrqD0UUtYIEGuFhxPg0rYWJJa6iTWTWuw4VJ6FI= X-Received: by 10.46.1.197 with SMTP id f66mr4826547lji.52.1465241300643; Mon, 06 Jun 2016 12:28:20 -0700 (PDT) Received: from localhost.localdomain ([83.220.238.250]) by smtp.gmail.com with ESMTPSA id m6sm1653843lbp.8.2016.06.06.12.28.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jun 2016 12:28:20 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 6 Jun 2016 22:28:08 +0300 Message-Id: <1465241288-5308-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 X-Topics: timers patch Subject: [lng-odp] [API-NEXT PATCH] api: timer: return code of set timer to enum X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" For some reason we defined function to set timer as int but have enum in api. It looks more clear to bind return code to current api description. Signed-off-by: Maxim Uvarov --- include/odp/api/spec/timer.h | 12 ++++++------ platform/linux-generic/odp_timer.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index 3f8fdd4..2c3bb8a 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -243,9 +243,9 @@ odp_event_t odp_timer_free(odp_timer_t tim); * @retval ODP_TIMER_NOEVENT Operation failed because timeout event not * specified in odp_timer_set call and not present in timer */ -int odp_timer_set_abs(odp_timer_t tim, - uint64_t abs_tck, - odp_event_t *tmo_ev); +odp_timer_set_t odp_timer_set_abs(odp_timer_t tim, + uint64_t abs_tck, + odp_event_t *tmo_ev); /** * Set a timer with a relative expiration time and user-provided event. @@ -268,9 +268,9 @@ int odp_timer_set_abs(odp_timer_t tim, * @retval ODP_TIMER_NOEVENT Operation failed because timeout event not * specified in call and not present in timer */ -int odp_timer_set_rel(odp_timer_t tim, - uint64_t rel_tck, - odp_event_t *tmo_ev); +odp_timer_set_t odp_timer_set_rel(odp_timer_t tim, + uint64_t rel_tck, + odp_event_t *tmo_ev); /** * Cancel a timer diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 996edf0..595b6ab 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -865,9 +865,9 @@ odp_event_t odp_timer_free(odp_timer_t hdl) return odp_buffer_to_event(old_buf); } -int odp_timer_set_abs(odp_timer_t hdl, - uint64_t abs_tck, - odp_event_t *tmo_ev) +odp_timer_set_t odp_timer_set_abs(odp_timer_t hdl, + uint64_t abs_tck, + odp_event_t *tmo_ev) { odp_timer_pool *tp = handle_to_tp(hdl); uint32_t idx = handle_to_idx(hdl, tp); @@ -882,9 +882,9 @@ int odp_timer_set_abs(odp_timer_t hdl, return ODP_TIMER_NOEVENT; } -int odp_timer_set_rel(odp_timer_t hdl, - uint64_t rel_tck, - odp_event_t *tmo_ev) +odp_timer_set_t odp_timer_set_rel(odp_timer_t hdl, + uint64_t rel_tck, + odp_event_t *tmo_ev) { odp_timer_pool *tp = handle_to_tp(hdl); uint32_t idx = handle_to_idx(hdl, tp);