mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user