From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5381FA04FD; Mon, 3 Oct 2022 20:34:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC8DB42B79; Mon, 3 Oct 2022 20:33:44 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 45A24427F7 for ; Mon, 3 Oct 2022 20:33:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664822020; x=1696358020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AW4pYxMoslSt1j5m4RBeZ7ptBzbL+QohFxXp7ruDp5o=; b=Tz3sqO/wlOi2d8AWTYhpcTiWIzcHP3QgGy+n0VSusdoeYh4kiMZM8bJg WNaU5HfGlF0MitHx77nxwx1yaA44Xj0mj3RQcqRr84cGqRG/288guBQzC kih+pfMFgrmEvJgrXGs+O7PgnQfYkhVAsLb4ulzO3Wxx8+yriIqKtlkvL aflDDnHEZdqlUGZABuYNav2Q1OEI9FYdLdedScPkTir6Zjk+ZNhc9deuG 4yrNoyuWgxGOevKNQOGjU6d55+dt8Rde7rNpKTF1JAQHB51PiOZzf1hGc I1Zx7+w2cRUJMdxjOHV7gAst80FwNb+KjbzBdVxATndCiReAVZ2r28WH6 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10489"; a="285907059" X-IronPort-AV: E=Sophos;i="5.93,366,1654585200"; d="scan'208";a="285907059" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2022 11:00:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10489"; a="618829417" X-IronPort-AV: E=Sophos;i="5.93,366,1654585200"; d="scan'208";a="618829417" Received: from unknown (HELO icx-npg-scs1-cp1.localdomain) ([10.233.180.245]) by orsmga007.jf.intel.com with ESMTP; 03 Oct 2022 11:00:40 -0700 From: Nicolas Chautru To: dev@dpdk.org, thomas@monjalon.net, gakhil@marvell.com Cc: maxime.coquelin@redhat.com, trix@redhat.com, mdr@ashroe.eu, bruce.richardson@intel.com, david.marchand@redhat.com, stephen@networkplumber.org, mingshan.zhang@intel.com, hemant.agrawal@nxp.com, Nicolas Chautru Subject: [PATCH v11 7/7] bbdev: remove unnecessary if-check Date: Mon, 3 Oct 2022 11:00:23 -0700 Message-Id: <20221003180023.13362-8-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20221003180023.13362-1-nicolas.chautru@intel.com> References: <1655491040-183649-6-git-send-email-nicolas.chautru@intel.com> <20221003180023.13362-1-nicolas.chautru@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Code clean up due to if-check not required Signed-off-by: Nicolas Chautru Acked-by: Maxime Coquelin --- lib/bbdev/rte_bbdev_op.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index c322d15dd5..e29a18d0e0 100644 --- a/lib/bbdev/rte_bbdev_op.h +++ b/lib/bbdev/rte_bbdev_op.h @@ -969,7 +969,6 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_enc_op **ops, uint16_t num_ops) { struct rte_bbdev_op_pool_private *priv; - int ret; /* Check type */ priv = (struct rte_bbdev_op_pool_private *) @@ -979,11 +978,7 @@ rte_bbdev_enc_op_alloc_bulk(struct rte_mempool *mempool, return -EINVAL; /* Get elements */ - ret = rte_mempool_get_bulk(mempool, (void **)ops, num_ops); - if (unlikely(ret < 0)) - return ret; - - return 0; + return rte_mempool_get_bulk(mempool, (void **)ops, num_ops); } /** @@ -1005,7 +1000,6 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_dec_op **ops, uint16_t num_ops) { struct rte_bbdev_op_pool_private *priv; - int ret; /* Check type */ priv = (struct rte_bbdev_op_pool_private *) @@ -1015,11 +1009,7 @@ rte_bbdev_dec_op_alloc_bulk(struct rte_mempool *mempool, return -EINVAL; /* Get elements */ - ret = rte_mempool_get_bulk(mempool, (void **)ops, num_ops); - if (unlikely(ret < 0)) - return ret; - - return 0; + return rte_mempool_get_bulk(mempool, (void **)ops, num_ops); } /** @@ -1042,20 +1032,14 @@ rte_bbdev_fft_op_alloc_bulk(struct rte_mempool *mempool, struct rte_bbdev_fft_op **ops, uint16_t num_ops) { struct rte_bbdev_op_pool_private *priv; - int ret; /* Check type */ - priv = (struct rte_bbdev_op_pool_private *) - rte_mempool_get_priv(mempool); + priv = (struct rte_bbdev_op_pool_private *) rte_mempool_get_priv(mempool); if (unlikely(priv->type != RTE_BBDEV_OP_FFT)) return -EINVAL; /* Get elements */ - ret = rte_mempool_get_bulk(mempool, (void **)ops, num_ops); - if (unlikely(ret < 0)) - return ret; - - return 0; + return rte_mempool_get_bulk(mempool, (void **)ops, num_ops); } /** -- 2.37.1