xiaoxiang781216 commented on code in PR #7207: URL: https://github.com/apache/incubator-nuttx/pull/7207#discussion_r983491874
########## include/sys/poll.h: ########## @@ -117,7 +122,8 @@ struct pollfd /* Non-standard fields used internally by NuttX. */ FAR void *ptr; /* The psock or file being polled */ - FAR sem_t *sem; /* Pointer to semaphore used to post output event */ + FAR void *cbargs; /* The poll callback function arguments */ Review Comment: ```suggestion FAR void *args; /* The poll callback function arguments */ ``` ########## fs/vfs/fs_epoll.c: ########## @@ -365,7 +365,7 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev) return -1; } - if (eph->poll[0].sem) + if (eph->poll[0].cbargs) Review Comment: remove the check because it's already checked by poll_notify ########## fs/vfs/fs_poll.c: ########## @@ -277,6 +279,36 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: poll_default_cb + * + * Description: + * The default poll callback function, this function do the final step of + * poll notification. + * + * Input Parameters: + * fds - The fds + * + * Returned Value: + * None + * + ****************************************************************************/ + +void poll_default_cb(FAR struct pollfd *fds) +{ + int semcount; Review Comment: ```suggestion int semcount = 0; ``` ########## fs/vfs/fs_poll.c: ########## @@ -317,15 +348,9 @@ void poll_notify(FAR struct pollfd **afds, int nfds, pollevent_t eventset) fds->revents &= ~POLLOUT; } - if (fds->revents != 0) + if (fds->revents != 0 && fds->cb) { - finfo("Report events: %08" PRIx32 "\n", fds->revents); Review Comment: keep this line and remove line 302 -- 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