From patchwork Thu Oct 29 10:24:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 55749 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp466045lbr; Thu, 29 Oct 2015 03:25:07 -0700 (PDT) X-Received: by 10.140.151.140 with SMTP id 134mr1069081qhx.25.1446114307332; Thu, 29 Oct 2015 03:25:07 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id e14si603935qhc.83.2015.10.29.03.25.07; Thu, 29 Oct 2015 03:25:07 -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; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id E3DB26203E; Thu, 29 Oct 2015 10:25:06 +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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 00DD36202E; Thu, 29 Oct 2015 10:25:01 +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 CC8E562039; Thu, 29 Oct 2015 10:24:59 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by lists.linaro.org (Postfix) with ESMTPS id B21C862027 for ; Thu, 29 Oct 2015 10:24:58 +0000 (UTC) Received: by lbbes7 with SMTP id es7so24937255lbb.2 for ; Thu, 29 Oct 2015 03:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=TtlNvzm7OAj6HqdRS5aELEgnHtXZq6Lc0t1wSvpkHl0=; b=uqDzMx70WZJELiNk0aEwLOK0uPIqNjSCuGXiWS3r5C/R+v3Ij7QKAUm0tn9uD9yUsr zw+KlE/Tg9pSRfjvx4szaWyq79PhGdlzKUEaKkj5iFoKmBRb0GCqrHfTClFCzKUiXNYB b5HNI3413KgOYSsDIR1vGRHaZceH7fUDKO6XtE9g24lT6YePKo9PmZdznADRxX8UP6lQ I7OrCd3OPbOi+1sphHLXrZZJCdY0C+sWJsqiSiFS29OIyvo50QzEDqybiLnKJhm5aT9y DmGCfeEmgtRTKapYeRrVmR0cowTLUsR9Et6NzTpuCCGGMQtAHB0LYAMVRmerQGbLedvl Wwjw== 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=TtlNvzm7OAj6HqdRS5aELEgnHtXZq6Lc0t1wSvpkHl0=; b=DovXdkBtAHpjIYAv9jbSVo75mnuha5xg93XKopyKZRvIr0XMokXAyaSrOuqhXQszLg Ad5FG7oAVAki87kW1fMYBVBovDU/2sHzb1dkvYU9rDfCFP32SUPE3Rg+pe/UCQnheRBK mmN4PILdOk+lwciaBlKljaNx0gLV3qtmqVenvnWY9HlSBV0wgJSV2yyF1+4P7zYgHiqR zudHEk7sjl1hV7A/jJXtfo7/Zbt0co4ZNTbcHmk9/f/HEYO+6PPmewY9AXu7SZnvNjPi mEoT1kYeWqbtm+3Rbd9KWYSsRRTNhl0qooKgW4EpTppGsOUXw1ybMJ2Nym5su72KpfHE 0Y8w== X-Gm-Message-State: ALoCoQkxF9KTjABXtYUHBd1PDmzKQdhC7V8dtT0Sex67l6Dxj37b8lp+aGSICfRh6krqyrZxBFTP X-Received: by 10.112.135.233 with SMTP id pv9mr545325lbb.42.1446114297669; Thu, 29 Oct 2015 03:24:57 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id d18sm170564lfe.44.2015.10.29.03.24.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 03:24:57 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 29 Oct 2015 13:24:54 +0300 Message-Id: <1446114294-13085-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] validation: check return code from odp_queue_lock_count() 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" odp_queue_lock_count() return int not uint32_t where -1 is assigned for error. Bug: https://bugs.linaro.org/show_bug.cgi?id=1867 Signed-off-by: Maxim Uvarov Reviewed-by: Bill Fischofer --- test/validation/scheduler/scheduler.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 89c1099..e8f5844 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -417,8 +417,11 @@ static void *schedule_common_(void *arg) continue; if (sync == ODP_SCHED_SYNC_ORDERED) { - uint32_t ndx; - uint32_t ndx_max = odp_queue_lock_count(from); + int ndx; + int ndx_max; + + ndx_max = odp_queue_lock_count(from); + CU_ASSERT_FATAL(ndx_max >= 0); qctx = odp_queue_context(from); bctx = odp_buffer_addr( @@ -442,8 +445,11 @@ static void *schedule_common_(void *arg) continue; num = 1; if (sync == ODP_SCHED_SYNC_ORDERED) { - uint32_t ndx; - uint32_t ndx_max = odp_queue_lock_count(from); + int ndx; + int ndx_max; + + ndx_max = odp_queue_lock_count(from); + CU_ASSERT_FATAL(ndx_max >= 0); qctx = odp_queue_context(from); bctx = odp_buffer_addr(buf); @@ -580,9 +586,11 @@ static void reset_queues(thread_args_t *args) for (k = 0; k < args->num_bufs; k++) { queue_context *qctx = odp_queue_context(queue); - uint32_t ndx; - uint32_t ndx_max = - odp_queue_lock_count(queue); + int ndx; + int ndx_max; + + ndx_max = odp_queue_lock_count(queue); + CU_ASSERT_FATAL(ndx_max >= 0); qctx->sequence = 0; for (ndx = 0; ndx < ndx_max; ndx++) qctx->lock_sequence[ndx] = 0;