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
+4 -4
View File
@@ -436,7 +436,7 @@ static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
* slot for the poll structure reference
*/
for (i = 0; i < ARRAY_SIZE(dev->pollfds); i++)
for (i = 0; i < nitems(dev->pollfds); i++)
{
/* Find an available slot */
@@ -450,7 +450,7 @@ static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
}
}
if (i >= ARRAY_SIZE(dev->pollfds))
if (i >= nitems(dev->pollfds))
{
fds->priv = NULL;
ret = -EBUSY;
@@ -470,7 +470,7 @@ static int usrsockdev_poll(FAR struct file *filep, FAR struct pollfd *fds,
eventset |= POLLIN;
}
poll_notify(dev->pollfds, ARRAY_SIZE(dev->pollfds), eventset);
poll_notify(dev->pollfds, nitems(dev->pollfds), eventset);
}
else
{
@@ -521,7 +521,7 @@ int usrsock_request(FAR struct iovec *iov, unsigned int iovcnt)
/* Notify daemon of new request. */
poll_notify(dev->pollfds, ARRAY_SIZE(dev->pollfds), POLLIN);
poll_notify(dev->pollfds, nitems(dev->pollfds), POLLIN);
}
else
{