From patchwork Thu Mar 26 16:43:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 46372 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A76CE21584 for ; Thu, 26 Mar 2015 16:44:11 +0000 (UTC) Received: by wibfv9 with SMTP id fv9sf7161671wib.1 for ; Thu, 26 Mar 2015 09:44:11 -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:from:to:date:message-id:in-reply-to :references:cc: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=EfkFDWhEnU3SO9gHl6xWhbbPurvRuuuhLIHCudMaQHY=; b=KP+QL5mYXKNIZaRlhGcq3ddcqHtlypVe85uWQ81pJPmI0umM1AFTcUL9I5tXWVPmcF ZVwk1Zy/uGcqbR3LAaE5WrzNL+4EchXR4hkrZ2HQLxql/AUwEhEKYX3ClB1xytU/HtGy M0NWrvHocL6Khu2O4W+EYeRgAnRhNpGwVSCMsPXoxa8iLQoT9E5PEW+yl4V1OGCu8hwD 8B2pfnha9g/1A/2Zv7cmwttFzNW49sMmUz0HSZ6zGsC9mL1reLybWqifYM+FLgdEOSRn yLi0DFygIRenO39e/np/wjNiVhN0RZVSVeLVQxYC0TuIA/SIS0JiMdf6qHAjoKEjcslo FDxA== X-Gm-Message-State: ALoCoQkeWv23mYtYV2+JRp6W4QPtvKvsXSkfONga+9RnmD2+Pe1+9ef0ZZj47lngom9tFKnQkYRm X-Received: by 10.112.181.166 with SMTP id dx6mr3530087lbc.17.1427388251005; Thu, 26 Mar 2015 09:44:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.5 with SMTP id lg5ls221710lab.106.gmail; Thu, 26 Mar 2015 09:44:10 -0700 (PDT) X-Received: by 10.112.149.10 with SMTP id tw10mr14419801lbb.78.1427388250819; Thu, 26 Mar 2015 09:44:10 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id r4si4989244lar.124.2015.03.26.09.44.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2015 09:44:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbug6 with SMTP id ug6so45320683lbb.3 for ; Thu, 26 Mar 2015 09:44:10 -0700 (PDT) X-Received: by 10.152.22.67 with SMTP id b3mr13805936laf.117.1427388250681; Thu, 26 Mar 2015 09:44:10 -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.57.201 with SMTP id k9csp726822lbq; Thu, 26 Mar 2015 09:44:09 -0700 (PDT) X-Received: by 10.52.106.35 with SMTP id gr3mr18108184vdb.78.1427388249103; Thu, 26 Mar 2015 09:44:09 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id xd12si7686685vdc.93.2015.03.26.09.44.07 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Mar 2015 09:44:09 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YbAt3-0000VP-LB; Thu, 26 Mar 2015 16:44:05 +0000 Received: from mail-qg0-f50.google.com ([209.85.192.50]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YbAsu-0000V3-47 for lng-odp@lists.linaro.org; Thu, 26 Mar 2015 16:43:56 +0000 Received: by qgfa8 with SMTP id a8so99868527qgf.0 for ; Thu, 26 Mar 2015 09:43:51 -0700 (PDT) X-Received: by 10.55.50.203 with SMTP id y194mr31679930qky.8.1427388213863; Thu, 26 Mar 2015 09:43:33 -0700 (PDT) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id 7sm3766944qhv.8.2015.03.26.09.43.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 09:43:33 -0700 (PDT) From: Mike Holmes To: ola.liljedahl@linaro.org Date: Thu, 26 Mar 2015 12:43:26 -0400 Message-Id: <1427388206-4028-2-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1427388206-4028-1-git-send-email-mike.holmes@linaro.org> References: <1427388206-4028-1-git-send-email-mike.holmes@linaro.org> X-Topics: timers patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH 2/2] linux-generic: timer: convert assert to ODP_ASSERT X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mike.holmes@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.181 as permitted sender) smtp.mail=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 ODP implementations should not call assert directly. Signed-off-by: Mike Holmes Reviewed-by: Bill Fischofer --- platform/linux-generic/odp_timer.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index b7cb04f..500f7f1 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -23,9 +23,7 @@ /* For snprint, POSIX timers and sigevent */ #define _POSIX_C_SOURCE 200112L -#include #include -#include #include #include #include @@ -123,8 +121,8 @@ static void timer_init(odp_timer *tim, /* Teardown when timer is freed */ static void timer_fini(odp_timer *tim, tick_buf_t *tb) { - assert(tb->exp_tck.v == TMO_UNUSED); - assert(tb->tmo_buf == ODP_BUFFER_INVALID); + ODP_ASSERT(tb->exp_tck.v == TMO_UNUSED); + ODP_ASSERT(tb->tmo_buf == ODP_BUFFER_INVALID); tim->queue = ODP_QUEUE_INVALID; tim->user_ptr = NULL; } @@ -137,7 +135,7 @@ static inline uint32_t get_next_free(odp_timer *tim) static inline void set_next_free(odp_timer *tim, uint32_t nf) { - assert(tim->queue == ODP_QUEUE_INVALID); + ODP_ASSERT(tim->queue == ODP_QUEUE_INVALID); /* Reusing 'queue' for next free index */ tim->queue = _odp_cast_scalar(odp_queue_t, nf); } @@ -195,7 +193,7 @@ static inline uint32_t handle_to_idx(odp_timer_t hdl, static inline odp_timer_t tp_idx_to_handle(struct odp_timer_pool_s *tp, uint32_t idx) { - assert(idx < (1U << INDEX_BITS)); + ODP_ASSERT(idx < (1U << INDEX_BITS)); return (tp->tp_idx << INDEX_BITS) | idx; } @@ -281,7 +279,7 @@ static inline odp_timer_t timer_alloc(odp_timer_pool *tp, if (odp_likely(tp->num_alloc < tp->param.num_timers)) { tp->num_alloc++; /* Remove first unused timer from free list */ - assert(tp->first_free != tp->param.num_timers); + ODP_ASSERT(tp->first_free != tp->param.num_timers); uint32_t idx = tp->first_free; odp_timer *tim = &tp->timers[idx]; tp->first_free = get_next_free(tim); @@ -322,7 +320,7 @@ static inline odp_buffer_t timer_free(odp_timer_pool *tp, uint32_t idx) odp_spinlock_lock(&tp->lock); set_next_free(tim, tp->first_free); tp->first_free = idx; - assert(tp->num_alloc != 0); + ODP_ASSERT(tp->num_alloc != 0); tp->num_alloc--; odp_spinlock_unlock(&tp->lock); @@ -597,7 +595,7 @@ static unsigned odp_timer_pool_expire(odp_timer_pool_t tpid, uint64_t tick) unsigned nexp = 0; uint32_t i; - assert(high_wm <= tpid->param.num_timers); + ODP_ASSERT(high_wm <= tpid->param.num_timers); for (i = 0; i < high_wm;) { #ifdef __ARM_ARCH /* As a rare occurence, we can outsmart the HW prefetcher