[v2,3/3] crypto/armv8: remove redundant assert definition

Message ID 20200728092406.9259-4-ruifeng.wang@arm.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series armv8 crypto PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Ruifeng Wang July 28, 2020, 9:24 a.m. UTC
  No need to define assert function in PMD since RTE provides the same.
Remove private definition and use RTE_VERIFY instead.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 drivers/crypto/armv8/armv8_pmd_private.h | 8 --------
 drivers/crypto/armv8/rte_armv8_pmd.c     | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)
  

Comments

Akhil Goyal July 28, 2020, 7:49 p.m. UTC | #1
> No need to define assert function in PMD since RTE provides the same.
> Remove private definition and use RTE_VERIFY instead.
> 
> Suggested-by: David Marchand <david.marchand@redhat.com>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>  drivers/crypto/armv8/armv8_pmd_private.h | 8 --------
>  drivers/crypto/armv8/rte_armv8_pmd.c     | 2 +-
>  2 files changed, 1 insertion(+), 9 deletions(-)
> 
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  

Patch

diff --git a/drivers/crypto/armv8/armv8_pmd_private.h b/drivers/crypto/armv8/armv8_pmd_private.h
index 709b3d536..66b03fb92 100644
--- a/drivers/crypto/armv8/armv8_pmd_private.h
+++ b/drivers/crypto/armv8/armv8_pmd_private.h
@@ -30,14 +30,6 @@  extern int crypto_armv8_log_type;
 			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD),	\
 			__func__, __LINE__, ## args)
 
-#define ARMV8_CRYPTO_ASSERT(con)				\
-do {								\
-	if (!(con)) {						\
-		rte_panic("condition failed, line %u",		\
-			__LINE__);				\
-	}							\
-} while (0)
-
 #define NBBY		8		/* Number of bits in a byte */
 #define BYTE_LENGTH(x)	((x) / NBBY)	/* Number of bytes in x (round down) */
 
diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index a2b08d818..c95729db5 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -630,7 +630,7 @@  process_armv8_chained_op(struct armv8_crypto_qp *qp, struct rte_crypto_op *op,
 	arg.cipher.key = sess->cipher.key.data;
 	/* Acquire combined mode function */
 	crypto_func = sess->crypto_func;
-	ARMV8_CRYPTO_ASSERT(crypto_func != NULL);
+	RTE_VERIFY(crypto_func != NULL);
 	error = crypto_func(csrc, cdst, clen, asrc, adst, alen, &arg);
 	if (error != 0) {
 		op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;