mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
+8
-10
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user