nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-02-02 20:31:22 +08:00
committed by Xiang Xiao
parent cf0769d613
commit 3a0fdb019d
95 changed files with 291 additions and 451 deletions
+8 -10
View File
@@ -31,6 +31,8 @@
#include <errno.h>
#include <debug.h>
#include <sys/param.h>
#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>
#include <nuttx/crypto/crypto.h>
@@ -43,10 +45,6 @@
* Pre-processor Definitions
****************************************************************************/
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#if defined(CONFIG_CRYPTO_AES)
/****************************************************************************
@@ -94,14 +92,14 @@ static int test_aes(void)
{
int i;
AES_CYPHER_TEST(AES_MODE_ECB, "ECB", ARRAY_SIZE(aes_enc_tv_template),
ARRAY_SIZE(aes_dec_tv_template), aes_enc_tv_template,
AES_CYPHER_TEST(AES_MODE_ECB, "ECB", nitems(aes_enc_tv_template),
nitems(aes_dec_tv_template), aes_enc_tv_template,
aes_dec_tv_template)
AES_CYPHER_TEST(AES_MODE_CBC, "CBC", ARRAY_SIZE(aes_cbc_enc_tv_template),
ARRAY_SIZE(aes_cbc_dec_tv_template),
AES_CYPHER_TEST(AES_MODE_CBC, "CBC", nitems(aes_cbc_enc_tv_template),
nitems(aes_cbc_dec_tv_template),
aes_cbc_enc_tv_template, aes_cbc_dec_tv_template)
AES_CYPHER_TEST(AES_MODE_CTR, "CTR", ARRAY_SIZE(aes_ctr_enc_tv_template),
ARRAY_SIZE(aes_ctr_dec_tv_template),
AES_CYPHER_TEST(AES_MODE_CTR, "CTR", nitems(aes_ctr_enc_tv_template),
nitems(aes_ctr_dec_tv_template),
aes_ctr_enc_tv_template, aes_ctr_dec_tv_template)
return OK;