mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/list.h>
|
||||
#include <nuttx/power/consumer.h>
|
||||
@@ -38,10 +40,6 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
|
||||
#endif
|
||||
|
||||
#define REGULATOR_RPMSG_EPT_NAME "rpmsg-regulator"
|
||||
|
||||
#define REGULATOR_RPMSG_ENABLE 0
|
||||
@@ -400,7 +398,7 @@ static int regulator_rpmsg_ept_cb(FAR struct rpmsg_endpoint *ept,
|
||||
nxsem_post(&cookie->sem);
|
||||
ret = 0;
|
||||
}
|
||||
else if (cmd < ARRAY_SIZE(g_regulator_rpmsg_handler)
|
||||
else if (cmd < nitems(g_regulator_rpmsg_handler)
|
||||
&& g_regulator_rpmsg_handler[cmd])
|
||||
{
|
||||
header->response = 1;
|
||||
|
||||
Reference in New Issue
Block a user