From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 5EA82A0542;
	Tue,  4 Oct 2022 19:17:53 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id D332F42B81;
	Tue,  4 Oct 2022 19:17:15 +0200 (CEST)
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by mails.dpdk.org (Postfix) with ESMTP id D4AFE4281E
 for <dev@dpdk.org>; Tue,  4 Oct 2022 19:17:11 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1664903832; x=1696439832;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=AW4pYxMoslSt1j5m4RBeZ7ptBzbL+QohFxXp7ruDp5o=;
 b=HTaeWD1x3u0sOLeCCEuJBLQdjIFPEkZNvPpqIylpPItfrlDOL326o13f
 feeiPvYL4K2PiB0oG1WcVf7rzN+Vt0FvFhYCLAHz0RWiiVxCaCppo4GtX
 RW3ZrMUmMZQWZ2/3UaDZirFN/qE66Jeiy08QO/4vX6QHH7pvRqsNANHJo
 rM5iVtw512Rzi39BwSW0lIzQLSb+EsOql9mUTKyUW8KKqYZWQbD8rmMUN
 PyKOpJbdW9cHKsvB91i6bR6WCVWgalu0UCHKnb0AN8pVT32oqQD3wmUNJ
 IOByhI+q//mIq5MEi1Ifm8RUk1A9W7K3dBkYbBIbpSJiwmpdLO/aXUkYR g==;
X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="290192305"
X-IronPort-AV: E=Sophos;i="5.95,158,1661842800"; d="scan'208";a="290192305"
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 04 Oct 2022 10:17:08 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="626256666"
X-IronPort-AV: E=Sophos;i="5.95,158,1661842800"; d="scan'208";a="626256666"
Received: from unknown (HELO icx-npg-scs1-cp1.localdomain) ([10.233.180.245])
 by fmsmga007.fm.intel.com with ESMTP; 04 Oct 2022 10:17:08 -0700
From: Nicolas Chautru <nicolas.chautru@intel.com>
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 <nicolas.chautru@intel.com>
Subject: [PATCH v12 7/7] bbdev: remove unnecessary if-check
Date: Tue,  4 Oct 2022 10:16:56 -0700
Message-Id: <20221004171656.17967-8-nicolas.chautru@intel.com>
X-Mailer: git-send-email 2.37.1
In-Reply-To: <20221004171656.17967-1-nicolas.chautru@intel.com>
References: <1655491040-183649-6-git-send-email-nicolas.chautru@intel.com>
 <20221004171656.17967-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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Code clean up due to if-check not required

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 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