MTres19 commented on a change in pull request #2641:
URL: https://github.com/apache/incubator-nuttx/pull/2641#discussion_r774280728



##########
File path: drivers/can/can.c
##########
@@ -609,24 +609,24 @@ static ssize_t can_read(FAR struct file *filep, FAR char 
*buffer,
 
       fifo = &reader->fifo;
 
-      while (fifo->rx_head == fifo->rx_tail)
+      if (filep->f_oflags & O_NONBLOCK)
+        {
+          ret = nxsem_trywait(&fifo->rx_sem);

Review comment:
       +1 for removing the unnecessary wrappers if no one's opposed.




-- 
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


Reply via email to