Code clean up due to if-check not required

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

Reply via email to