hartmannathan commented on code in PR #17300:
URL: https://github.com/apache/nuttx/pull/17300#discussion_r2508146991
##########
sched/sched/sched_unlock.c:
##########
@@ -64,13 +64,13 @@ void sched_unlock(void)
/* rtcb may be NULL only during early boot-up phases */
- DEBUGASSERT(rtcb == NULL || rtcb->lockcount > 0);
+ DEBUGASSERT(rtcb && rtcb->lockcount > 0);
Review Comment:
Ditto.
##########
sched/sched/sched_lock.c:
##########
@@ -76,13 +76,13 @@ void sched_lock(void)
* integer type.
*/
- DEBUGASSERT(rtcb == NULL || rtcb->lockcount < MAX_LOCK_COUNT);
+ DEBUGASSERT(rtcb && rtcb->lockcount < MAX_LOCK_COUNT);
Review Comment:
Keep in mind that `DEBUGASSERT()` may be a NOP. In other words, this check
for `rtcb` will not be done if debug features are not enabled. Is that the
intention?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]