From patchwork Thu Sep 22 17:45:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 116662 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ADC86A0543; Thu, 22 Sep 2022 19:46:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D022040156; Thu, 22 Sep 2022 19:46:02 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 8801640691 for ; Thu, 22 Sep 2022 19:45:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663868757; x=1695404757; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=oUa9wmYWRJZqIeTGCwrTgPb+n43D7tuRA2p8XawSads=; b=X30nKcFf6vgKfxiCNq64fQhxfXtNmMZE5HyUhNEn0dRVJvn0x6BCnwEy wSu41Z/pfelqWOP20prqTOrWMkExa7+T6YQb/0kzFZ/KkCHigLUvoqiVL xxEvk4V6QLMogELeUncQAJjnFP3bAYSMCf9svXYgVLXUKloWkP/2xid0Z VMMG07ARTxevCSGDh0NK7G9s3MrcDYFgnNXWN2olKa5OI0fl1Vl2KNErV Zyi2eHi3/VQHiqmhvAdRiiDdJaWATrZiKkColvGBVU+OQljclRJW1p7Hr b0SmHSwxvI41e9uksgU381GQI26hKrVYQzCrbH8Q0yZdnrxYkaa3FEeEI Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10478"; a="280099979" X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="280099979" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2022 10:45:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,337,1654585200"; d="scan'208";a="619887818" Received: from unknown (HELO icx-npg-scs1-cp1.localdomain) ([10.233.180.245]) by orsmga002.jf.intel.com with ESMTP; 22 Sep 2022 10:45:55 -0700 From: Nic 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 v9 7/7] bbdev: remove unnecessary if-check Date: Thu, 22 Sep 2022 10:45:22 -0700 Message-Id: <1663868722-39949-8-git-send-email-nicolas.chautru@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1663868722-39949-1-git-send-email-nicolas.chautru@intel.com> References: <1655491040-183649-6-git-send-email-nicolas.chautru@intel.com> <1663868722-39949-1-git-send-email-nicolas.chautru@intel.com> 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 From: Nicolas Chautru 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 899cd22..2f773e4 100644 --- a/lib/bbdev/rte_bbdev_op.h +++ b/lib/bbdev/rte_bbdev_op.h @@ -959,7 +959,6 @@ struct rte_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 *) @@ -969,11 +968,7 @@ struct rte_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); } /** @@ -995,7 +990,6 @@ struct rte_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 *) @@ -1005,11 +999,7 @@ struct rte_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); } /** @@ -1032,20 +1022,14 @@ struct rte_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); } /**