From patchwork Wed Jun 24 10:13:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 50263 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 8727B228FC for ; Wed, 24 Jun 2015 10:13:34 +0000 (UTC) Received: by wilk19 with SMTP id k19sf12129457wil.3 for ; Wed, 24 Jun 2015 03:13:33 -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: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=tsMF11ehEVxePNRX2Kwqi6Ry3o9T5khrjVwQcQ+1O6Y=; b=I5FJCn35fcZI7EZQnSHHbQGmM1caJXF+yALEHTaL0N4pbQh78q/62O3A9q5Qasxh+i K5DRWBVxTfaWKc4fcXPiTwdOga4zi7DNqKQv9ywlLQf1DX4EAdPq+aQS80Fckh9f1k9l dnkttz+fSiQYII4MSsG0/eunTXoaxKI2VZDfJDz2Co0BlZEFbJaulrBiDjXsrVlVYsug cu3a3+leD4/+Z7WWuUE0ARnUsvv11Rwstm6evQXAvhZmzMmHKblOGqjmrrrub/aG+uEd Q6ZiXykfEKiuS5qR5P6mafa4ZCMCn/P+E64kyuF8HhVq+EL5KvRTtu5DpvBB4L5yDcHt wOLw== X-Gm-Message-State: ALoCoQmsoA5QWGnUjWQbeSO92JkKEGaPYdLka7vPHdvx1oCyVXACxSG0XJzoSE+31h8gQyWMn3rc X-Received: by 10.152.5.2 with SMTP id o2mr35514763lao.0.1435140813015; Wed, 24 Jun 2015 03:13:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.194 with SMTP id v2ls200291lag.59.gmail; Wed, 24 Jun 2015 03:13:32 -0700 (PDT) X-Received: by 10.152.1.227 with SMTP id 3mr39137066lap.61.1435140812667; Wed, 24 Jun 2015 03:13:32 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id rk9si21629568lbb.152.2015.06.24.03.13.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 03:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by lagi2 with SMTP id i2so23045973lag.2 for ; Wed, 24 Jun 2015 03:13:32 -0700 (PDT) X-Received: by 10.112.42.50 with SMTP id k18mr11599187lbl.76.1435140812425; Wed, 24 Jun 2015 03:13:32 -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.108.230 with SMTP id hn6csp3679587lbb; Wed, 24 Jun 2015 03:13:31 -0700 (PDT) X-Received: by 10.140.109.199 with SMTP id l65mr49819397qgf.91.1435140811215; Wed, 24 Jun 2015 03:13:31 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w134si25183054qha.90.2015.06.24.03.13.29; Wed, 24 Jun 2015 03:13:31 -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 A544C61F38; Wed, 24 Jun 2015 10:13:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal 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 ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 7A93461EE9; Wed, 24 Jun 2015 10:13: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 A887161EED; Wed, 24 Jun 2015 10:13:23 +0000 (UTC) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by lists.linaro.org (Postfix) with ESMTPS id BB27461EE8 for ; Wed, 24 Jun 2015 10:13:22 +0000 (UTC) Received: by lbbvz5 with SMTP id vz5so23295611lbb.0 for ; Wed, 24 Jun 2015 03:13:21 -0700 (PDT) X-Received: by 10.112.161.40 with SMTP id xp8mr38959705lbb.71.1435140800860; Wed, 24 Jun 2015 03:13:20 -0700 (PDT) Received: from khorivan.itg.ti.com ([195.238.92.128]) by mx.google.com with ESMTPSA id bd7sm4553584lbc.26.2015.06.24.03.13.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jun 2015 03:13:19 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Wed, 24 Jun 2015 13:13:12 +0300 Message-Id: <1435140792-25439-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: timers patch Subject: [lng-odp] [PATCH] linux-generic: timer: set timer queue to ODP_QUEUE_INVALID on init 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.45 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 The set_next_free() checks if timer queue is not set, that is ODP_QUEUE_INVALID. In case of linux-generic the invalid queue is 0. By coincidence, after allocation, the timer queue is also 0, by this way the ODP_ASSERT is masked. In case ODP_QUEUE_INVALID is another from 0 the test generates error. It's not correct, the code shouldn't have such kind dependency from macro definition, and it prevents to re-use this code for another platforms with different ODP_QUEUE_INVALID. So, fix it. Signed-off-by: Ivan Khoronzhuk --- platform/linux-generic/odp_timer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 0d0f48b..68d7b11 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -244,6 +244,7 @@ static odp_timer_pool *odp_timer_pool_new( /* Initialize all odp_timer entries */ uint32_t i; for (i = 0; i < tp->param.num_timers; i++) { + tp->timers[i].queue = ODP_QUEUE_INVALID; set_next_free(&tp->timers[i], i + 1); tp->timers[i].user_ptr = NULL; odp_atomic_init_u64(&tp->tick_buf[i].exp_tck, TMO_UNUSED);