davids5 commented on a change in pull request #4782:
URL: https://github.com/apache/incubator-nuttx/pull/4782#discussion_r747511117



##########
File path: sched/semaphore/sem_trywait.c
##########
@@ -69,10 +69,6 @@ int nxsem_trywait(FAR sem_t *sem)
   irqstate_t flags;
   int ret;
 
-  /* This API should not be called from interrupt handlers */

Review comment:
       I see your point. But config.h is global AND you have removed a 
protection (to facilitate a DEBUG only feature)!
   
   My concern would for a caller of nxsem_trywait (direct) and now the 
protection is gone. Maybe that does not matter, but if you add 
   ```
   #ifdnef CONFIG_DEBUG_MM
     /* This API should not be called from interrupt handlers */
     DEBUGASSERT(sem != NULL && up_interrupt_context() == false);
    #endif
   ```
   It would help to debug bad calling sequence. Is the only objection having 
the condition checked CONFIG_DEBUG_MM in 
   sched/semaphore/sem_trywait.c?  Have you considered that the cosmetics is 
minor compared to the debug time that would be spent?
   




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