CV-Bowen commented on code in PR #7131: URL: https://github.com/apache/incubator-nuttx/pull/7131#discussion_r979510556
########## drivers/serial/uart_bth4.c: ########## @@ -398,10 +383,10 @@ static int uart_bth4_poll(FAR struct file *filep, FAR struct pollfd *fds, if (!circbuf_is_empty(&dev->circbuf)) { - eventset |= (fds->events & POLLIN); + eventset |= POLLIN; } - eventset |= (fds->events & POLLOUT); + eventset |= POLLOUT; if (eventset) Review Comment: Done ########## drivers/sensors/sensor.c: ########## @@ -899,25 +883,25 @@ static int sensor_poll(FAR struct file *filep, if (filep->f_oflags & O_NONBLOCK) { - eventset |= (fds->events & POLLIN); + eventset |= POLLIN; } else { nxsem_get_value(&user->buffersem, &semcount); if (semcount > 0) { - eventset |= (fds->events & POLLIN); + eventset |= POLLIN; } } } else if (sensor_is_updated(upper, user)) { - eventset |= (fds->events & POLLIN); + eventset |= POLLIN; } if (user->changed) { - eventset |= (fds->events & POLLPRI); + eventset |= POLLPRI; } if (eventset) Review Comment: Done ########## drivers/net/tun.c: ########## @@ -1270,7 +1264,7 @@ int tun_poll(FAR struct file *filep, FAR struct pollfd *fds, bool setup) if (priv->read_d_len != 0 || priv->write_d_len != 0) { - eventset |= (fds->events & POLLIN); + eventset |= POLLIN; } if (eventset) Review Comment: Done ########## fs/mqueue/mq_open.c: ########## @@ -127,12 +127,12 @@ static int nxmq_file_poll(FAR struct file *filep, if (msgq->nmsgs < msgq->maxmsgs) { - eventset |= (fds->events & POLLOUT); + eventset |= POLLOUT; } if (msgq->nmsgs) { - eventset |= (fds->events & POLLIN); + eventset |= POLLIN; } if (eventset) Review Comment: Done ########## fs/vfs/fs_poll.c: ########## @@ -276,6 +277,60 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: poll_notify + * + * Description: + * Notify the poll, this function should be called by drivers to notify + * the caller the poll is ready. + * + * Input Parameters: + * afds - The fds array + * nfds - Number of fds array + * eventset - List of events to check for activity + * + * Returned Value: + * None + * + ****************************************************************************/ + +void poll_notify(FAR struct pollfd **afds, int nfds, pollevent_t eventset) +{ + int i; + int semcount; + FAR struct pollfd *fds; + + DEBUGASSERT(afds != NULL && nfds >= 1); + + for (i = 0; i < nfds; i++) Review Comment: Done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org