From patchwork Wed Oct 21 05:14:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 55341 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 9209722EA2 for ; Wed, 21 Oct 2015 05:16:23 +0000 (UTC) Received: by lbbor1 with SMTP id or1sf13506995lbb.2 for ; Tue, 20 Oct 2015 22:16: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: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=itWmFsy7sYhKLWTG+BT5LGS85cb0bFN5LQ9YGJsf/GI=; b=Vb1jOrjfKVPswPGk65iK2/t+SSPGKgnM7zfpkA93y46nO8A6WeRqg7BR1XRxjF0q7f DrOJLv7TBXo42Dd5vhgZ7OsexJvxR3wckrQBvs5dOOALR7Ml1nWA6lD227zrQnVH5i0F dM+Ff+aJlogvHezH8qrGeIsTyYqlS6jD6/NZVZgFUEPsr9nN+jvALs1qO6kj8bLYUIUh zB+OfJlc6P/T0BAttYJZLXleWmBjqmeVVIL8Smb6B1Rj05kK2iBGcUcb55z2cIMX3ysT +vSLvuAptZ64NwHZ9lCZRJmZ2mMDBvnGsAl4t02mjzQd/zCVNsl9k4RirTfrxVYNBAQ5 nRtQ== X-Gm-Message-State: ALoCoQlWdoiWWQqiMQL6cE1fkmCrthDJvwMoFfY2ETI9oWfrhd324VeCBReKwfmdSEriEowB+y5s X-Received: by 10.112.144.105 with SMTP id sl9mr1576461lbb.3.1445404582520; Tue, 20 Oct 2015 22:16:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.152.199 with SMTP id a190ls162130lfe.62.gmail; Tue, 20 Oct 2015 22:16:22 -0700 (PDT) X-Received: by 10.25.143.146 with SMTP id r140mr2688854lfd.14.1445404582385; Tue, 20 Oct 2015 22:16:22 -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 yn5si5052015lbb.1.2015.10.20.22.16.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Oct 2015 22:16:22 -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 lbbwb3 with SMTP id wb3so30131190lbb.1 for ; Tue, 20 Oct 2015 22:16:22 -0700 (PDT) X-Received: by 10.112.199.137 with SMTP id jk9mr4043866lbc.86.1445404582223; Tue, 20 Oct 2015 22:16:22 -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.59.35 with SMTP id w3csp2467385lbq; Tue, 20 Oct 2015 22:16:21 -0700 (PDT) X-Received: by 10.55.25.105 with SMTP id k102mr8696426qkh.65.1445404581424; Tue, 20 Oct 2015 22:16:21 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h133si6441996qhc.117.2015.10.20.22.16.21; Tue, 20 Oct 2015 22:16:21 -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 1198161FF0; Wed, 21 Oct 2015 05:16:21 +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_H2, 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 EA9D861FE1; Wed, 21 Oct 2015 05:15:51 +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 7C1EF61FEF; Wed, 21 Oct 2015 05:15:46 +0000 (UTC) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by lists.linaro.org (Postfix) with ESMTPS id A020B61FCF for ; Wed, 21 Oct 2015 05:15:12 +0000 (UTC) Received: by padhk11 with SMTP id hk11so43469093pad.1 for ; Tue, 20 Oct 2015 22:15:12 -0700 (PDT) X-Received: by 10.68.134.73 with SMTP id pi9mr8403497pbb.55.1445404512015; Tue, 20 Oct 2015 22:15:12 -0700 (PDT) Received: from localhost.localdomain ([122.166.219.57]) by smtp.gmail.com with ESMTPSA id dd4sm6749251pbb.52.2015.10.20.22.15.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Oct 2015 22:15:11 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Wed, 21 Oct 2015 10:44:54 +0530 Message-Id: <1445404495-14144-3-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445404495-14144-1-git-send-email-bala.manoharan@linaro.org> References: <1445404495-14144-1-git-send-email-bala.manoharan@linaro.org> X-Topics: Classification patch Subject: [lng-odp] [API-NEXT/PATCHv1 3/4] validation: classification: remove redundant pool lookup function 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: bala.manoharan@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.mailfrom=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 pool lookup function is removed and pool_default variable is updated directly during pool create Signed-off-by: Balasubramanian Manoharan Reviewed-by: Ivan Khoronzhuk --- .../classification/odp_classification_test_pmr.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/test/validation/classification/odp_classification_test_pmr.c b/test/validation/classification/odp_classification_test_pmr.c index c6b733c..c058caf 100644 --- a/test/validation/classification/odp_classification_test_pmr.c +++ b/test/validation/classification/odp_classification_test_pmr.c @@ -19,7 +19,6 @@ odp_atomic_u32_t seq; int classification_suite_pmr_init(void) { - odp_pool_t pool; odp_pool_param_t param; odp_pool_param_init(¶m); @@ -28,16 +27,12 @@ int classification_suite_pmr_init(void) param.pkt.num = SHM_PKT_NUM_BUFS; param.type = ODP_POOL_PACKET; - pool = odp_pool_create("classification_pmr_pool", ¶m); - if (ODP_POOL_INVALID == pool) { + pool_default = odp_pool_create("classification_pmr_pool", ¶m); + if (ODP_POOL_INVALID == pool_default) { fprintf(stderr, "Packet pool creation failed.\n"); return -1; } - pool_default = odp_pool_lookup("classification_pmr_pool"); - if (pool_default == ODP_POOL_INVALID) - return -1; - odp_atomic_init_u32(&seq, 0); return 0; } @@ -46,11 +41,9 @@ odp_pktio_t create_pktio(odp_queue_type_t q_type) { odp_pktio_t pktio; odp_pktio_param_t pktio_param; - odp_pool_t pool; int ret; - pool = odp_pool_lookup("classification_pmr_pool"); - if (pool == ODP_POOL_INVALID) + if (pool_default == ODP_POOL_INVALID) return ODP_PKTIO_INVALID; odp_pktio_param_init(&pktio_param); @@ -59,9 +52,9 @@ odp_pktio_t create_pktio(odp_queue_type_t q_type) else pktio_param.in_mode = ODP_PKTIN_MODE_SCHED; - pktio = odp_pktio_open("loop", pool, &pktio_param); + pktio = odp_pktio_open("loop", pool_default, &pktio_param); if (pktio == ODP_PKTIO_INVALID) { - ret = odp_pool_destroy(pool); + ret = odp_pool_destroy(pool_default); if (ret) fprintf(stderr, "unable to destroy pool.\n"); return ODP_PKTIO_INVALID;