sched/semaphore: Correct the return value comment of nxsem_init/nxmutex_init

nxsem_init(), nxsem_destroy(), nxmutex_init(), nxmutex_destroy(),
nxrmutex_init() and nxrmutex_destroy() cannot fail, so promising a
negated errno value on failure documents an error that is never returned.
The coding standard asks the returned value description to identify all
error values of a function, and there are none, so state that OK is
always returned.

Follows "sched/semaphore: Remove the return value check of
nxsem_init/nxmutex_init", which removed the last checks of these values.

Assisted-by: DeepSeek Harness:deepseek-flash
Signed-off-by: rongbaichuan <rongbaichuan1027@163.com>
This commit is contained in:
rongbaichuan 2026-09-24 18:38:50 +08:00 • committed by Alin Jerpelea
parent 59d5ce0f31
commit 9c461f03ac
5 changed files with 9 additions and 18 deletions

View file

@ -110,8 +110,7 @@ void nxmutex_add_backtrace(FAR mutex_t *mutex);
*
* Return Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/
@ -471,8 +470,7 @@ static inline_function bool nxmutex_is_locked(FAR mutex_t *mutex)
*
* Return Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/
@ -735,8 +733,7 @@ static inline_function int nxmutex_setprioceiling(FAR mutex_t *mutex,
*
* Return Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/
@ -757,8 +754,7 @@ static inline_function int nxrmutex_init(FAR rmutex_t *rmutex)
*
* Return Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/

View file

@ -158,8 +158,7 @@ extern "C"
*
* Returned Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/
@ -184,8 +183,7 @@ int nxsem_init(FAR sem_t *sem, int pshared, int32_t value);
*
* Returned Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/

View file

@ -77,8 +77,7 @@ void nxmutex_add_backtrace(FAR mutex_t *mutex)
*
* Return Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/

View file

@ -57,8 +57,7 @@
*
* Returned Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/

View file

@ -53,8 +53,7 @@
*
* Returned Value:
* This is an internal OS interface and should not be used by applications.
* It follows the NuttX internal error return policy: Zero (OK) is
* returned on success. A negated errno value is returned on failure.
* Zero (OK) is always returned.
*
****************************************************************************/