From patchwork Wed Jun 24 10:19: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: 50264 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 89AE9228FC for ; Wed, 24 Jun 2015 10:19:31 +0000 (UTC) Received: by lbbwc1 with SMTP id wc1sf9712164lbb.3 for ; Wed, 24 Jun 2015 03:19:30 -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=tsMF11ehEVxePNRX2Kwqi6Ry3o9T5khrjVwQcQ+1O6Y=; b=Uw6QwqMAv2RUDWfZz6ynhIZsAv3p2V6ywdJ0CtCkPF+Lbh4XO0TY2i5qpJDgljxvIe H1EB4gbfD1YbCi8lyrHpFJA+8IXS+b+vt5idN4qWIxIJCI4VTjnJE94DwwTdggVU5/Zt Js5kTmK1ahLFrrk7nI4X26FzaTXF9dmOIzvp+MAQ2j1Onlvmjuow5ntAo+sa0L82cgMZ XXC8IvC83ZQ54vfk+aRVzgvRuN3k/S8yiQxCvfI2944yNIAuF0X3zraN5Gm2A/PA505f qVqxu3lvkTCcckWxjRD/tuj1o71CLchHHnhK/NgtEvos10HdTwxoOL88Oq9gW9FDIEZc IyTg== X-Gm-Message-State: ALoCoQkHSGmE9sVLXcnGSoDHSWFhWxYVSCu/Z/fCcP5enh3tBFs6DSbR7GB1WCYFGUdr8OL3kYXa X-Received: by 10.180.89.231 with SMTP id br7mr1434260wib.0.1435141170493; Wed, 24 Jun 2015 03:19:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.103 with SMTP id l7ls183667laf.35.gmail; Wed, 24 Jun 2015 03:19:30 -0700 (PDT) X-Received: by 10.152.205.67 with SMTP id le3mr39091980lac.50.1435141170261; Wed, 24 Jun 2015 03:19:30 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id bo7si21653540lbb.108.2015.06.24.03.19.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jun 2015 03:19:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbpo10 with SMTP id po10so23366815lbb.3 for ; Wed, 24 Jun 2015 03:19:30 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr39445343lbc.19.1435141170037; Wed, 24 Jun 2015 03:19:30 -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 hn6csp3682762lbb; Wed, 24 Jun 2015 03:19:29 -0700 (PDT) X-Received: by 10.55.42.89 with SMTP id q86mr73614601qkh.74.1435141168688; Wed, 24 Jun 2015 03:19:28 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h38si25224254qga.34.2015.06.24.03.19.26; Wed, 24 Jun 2015 03:19:28 -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 DF75C61F00; Wed, 24 Jun 2015 10:19:26 +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 6D56461E33; Wed, 24 Jun 2015 10:19:23 +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 994E461EE8; Wed, 24 Jun 2015 10:19:21 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by lists.linaro.org (Postfix) with ESMTPS id B31D961E11 for ; Wed, 24 Jun 2015 10:19:20 +0000 (UTC) Received: by lbbvz5 with SMTP id vz5so23379056lbb.0 for ; Wed, 24 Jun 2015 03:19:19 -0700 (PDT) X-Received: by 10.112.125.166 with SMTP id mr6mr39087187lbb.83.1435141159711; Wed, 24 Jun 2015 03:19:19 -0700 (PDT) Received: from khorivan.itg.ti.com ([195.238.92.128]) by mx.google.com with ESMTPSA id cq1sm4056633lad.18.2015.06.24.03.19.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jun 2015 03:19:18 -0700 (PDT) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Wed, 24 Jun 2015 13:19:12 +0300 Message-Id: <1435141152-25579-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435140792-25439-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1435140792-25439-1-git-send-email-ivan.khoronzhuk@linaro.org> 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.217.176 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 Reviewed-by: Ola Liljedahl --- 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);