[v12,7/7] bbdev: remove unnecessary if-check

Message ID 20221004171656.17967-8-nicolas.chautru@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series bbdev changes for 22.11 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS

Commit Message

Chautru, Nicolas Oct. 4, 2022, 5:16 p.m. UTC
  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(-)
  

Patch

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);
 }
 
 /**