hartmannathan commented on PR #17300: URL: https://github.com/apache/nuttx/pull/17300#issuecomment-3516879344
> Since rtcb could be NULL, why does this commit remove the rtcb check? If you can accept the scenario where rtcb is a NULL pointer, why do you still need to check it in DEBUGASSERT? If rtcb is allowed to be NULL, then `if (rtcb == NULL)` check should be written before the DEBUGASSERT, and the DEBUGASSERT should check only the lockcount. If rtcb is not allowed to be NULL, then I guess both checks can be written in DEBUGASSERT. There may be a disadvantage to combining both checks in one DEBUGASSERT: if assertion fails, you won't know whether it's because of rtcb == NULL, or because of invalid lockcount. It might be better to write each condition in its own DEBUGASSERT. -- 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]
