test/crypto: use formal array size macro

Message ID 20210705115030.520497-1-rebecca.troy@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series test/crypto: use formal array size macro |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing fail Testing issues
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-abi-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Rebecca Troy July 5, 2021, 11:50 a.m. UTC
  Replaces the use of local ARRAY_SIZE macro, which is not used
anywhere else, with the formal RTE_DIM macro for better
consistency in crypto unit test.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
---
 app/test/test_cryptodev.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
  

Comments

Akhil Goyal July 6, 2021, 12:18 p.m. UTC | #1
> Replaces the use of local ARRAY_SIZE macro, which is not used
> anywhere else, with the formal RTE_DIM macro for better
> consistency in crypto unit test.
> 
> Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>
  
Akhil Goyal July 7, 2021, 2:40 p.m. UTC | #2
> 
> > Replaces the use of local ARRAY_SIZE macro, which is not used
> > anywhere else, with the formal RTE_DIM macro for better
> > consistency in crypto unit test.
> >
> > Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
> > ---
> Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 39db52b17a..b5ac5b048a 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -61,10 +61,6 @@ 
 #define IN_PLACE 0
 #define OUT_OF_PLACE 1
 
-#ifndef ARRAY_SIZE
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#endif
-
 static int gbl_driver_id;
 
 static enum rte_security_session_action_type gbl_action_type =
@@ -8736,7 +8732,7 @@  test_PDCP_SDAP_PROTO_encap_all(void)
 	int err, all_err = TEST_SUCCESS;
 	const struct pdcp_sdap_test *cur_test;
 
-	size = ARRAY_SIZE(list_pdcp_sdap_tests);
+	size = RTE_DIM(list_pdcp_sdap_tests);
 
 	for (i = 0; i < size; i++) {
 		cur_test = &list_pdcp_sdap_tests[i];
@@ -8778,7 +8774,7 @@  test_PDCP_SDAP_PROTO_decap_all(void)
 	int err, all_err = TEST_SUCCESS;
 	const struct pdcp_sdap_test *cur_test;
 
-	size = ARRAY_SIZE(list_pdcp_sdap_tests);
+	size = RTE_DIM(list_pdcp_sdap_tests);
 
 	for (i = 0; i < size; i++) {
 		cur_test = &list_pdcp_sdap_tests[i];