From d3ee760c6e0f512a0f8e85b538a89849addbfd9a Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Thu, 12 Dec 2024 10:05:30 +0100 Subject: [PATCH] Fix #1489, Clean up minor bugs + typos --- src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h | 2 +- src/bsp/generic-rtems/src/bsp_shell.c | 2 +- src/bsp/pc-rtems/src/bsp_start.c | 2 +- src/os/inc/osapi-binsem.h | 6 +++--- src/os/inc/osapi-clock.h | 2 +- src/os/inc/osapi-condvar.h | 4 ++-- src/os/inc/osapi-countsem.h | 6 +++--- src/os/inc/osapi-sockets.h | 4 ++-- src/os/inc/osapi-timer.h | 6 +++--- src/tests/idmap-api-test/idmap-api-test.c | 8 ++++---- src/tests/symbol-api-test/symbol-api-test.c | 6 +++--- src/unit-test-coverage/shared/src/coveragetest-filesys.c | 4 ++-- src/unit-test-coverage/shared/src/coveragetest-idmap.c | 2 +- src/unit-tests/oscore-test/ut_oscore_select_test.c | 2 +- src/unit-tests/osfile-test/ut_osfile_fileio_test.c | 2 +- 15 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h b/src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h index 176e1abc7..bee600999 100644 --- a/src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h +++ b/src/bsp/generic-rtems/config/default_bsp_rtems_cfg.h @@ -1,5 +1,5 @@ /************************************************************************ - * NASA Docket No. GSC-18,719-1, and identified as �~@~\core Flight System: Bootes�~@~] + * NASA Docket No. GSC-18,719-1, and identified as “core Flight System: Bootes” * * Copyright (c) 2020 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. diff --git a/src/bsp/generic-rtems/src/bsp_shell.c b/src/bsp/generic-rtems/src/bsp_shell.c index 369f693b3..d9a3bbfb3 100644 --- a/src/bsp/generic-rtems/src/bsp_shell.c +++ b/src/bsp/generic-rtems/src/bsp_shell.c @@ -71,7 +71,7 @@ void OS_BSP_Shell(void) status = rtems_shell_init("SHLL", RTEMS_MINIMUM_STACK_SIZE * 4, RTEMS_SHELL_PRIORITY, "/dev/console", false, false, NULL); - if (status < 0) + if (status != RTEMS_SUCCESSFUL) { printf("shell init failed: %d / %s\n", status, strerror(errno)); } diff --git a/src/bsp/pc-rtems/src/bsp_start.c b/src/bsp/pc-rtems/src/bsp_start.c index acdabe2c3..7f10bb02e 100644 --- a/src/bsp/pc-rtems/src/bsp_start.c +++ b/src/bsp/pc-rtems/src/bsp_start.c @@ -245,7 +245,7 @@ void OS_BSP_Setup(void) { status = rtems_shell_init("SHLL", RTEMS_MINIMUM_STACK_SIZE * 4, RTEMS_SHELL_PRIORITY, "/dev/console", false, false, NULL); - if (status < 0) + if (status != RTEMS_SUCCESSFUL) { printf("shell init failed: %d / %s\n", status, strerror(errno)); } diff --git a/src/os/inc/osapi-binsem.h b/src/os/inc/osapi-binsem.h index 51f849eb0..e2143a67f 100644 --- a/src/os/inc/osapi-binsem.h +++ b/src/os/inc/osapi-binsem.h @@ -62,7 +62,7 @@ typedef struct * * @return Execution status, see @ref OSReturnCodes * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_INVALID_POINTER if sen name or sem_id are NULL + * @retval #OS_INVALID_POINTER if sem_name or sem_id are NULL * @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME * @retval #OS_ERR_NO_FREE_IDS if all of the semaphore ids are taken * @retval #OS_ERR_NAME_TAKEN if this is already the name of a binary semaphore @@ -90,7 +90,7 @@ int32 OS_BinSemFlush(osal_id_t sem_id); /** * @brief Increment the semaphore value * - * The function unlocks the semaphore referenced by sem_id by performing + * The function unlocks the semaphore referenced by sem_id by performing * a semaphore unlock operation on that semaphore. If the semaphore value * resulting from this operation is positive, then no threads were blocked * waiting for the semaphore to become unlocked; the semaphore value is @@ -109,7 +109,7 @@ int32 OS_BinSemGive(osal_id_t sem_id); /** * @brief Decrement the semaphore value * - * The locks the semaphore referenced by sem_id by performing a + * The function locks the semaphore referenced by sem_id by performing a * semaphore lock operation on that semaphore. If the semaphore value * is currently zero, then the calling thread shall not return from * the call until it either locks the semaphore or the call is diff --git a/src/os/inc/osapi-clock.h b/src/os/inc/osapi-clock.h index 619dfe62b..fd3742357 100644 --- a/src/os/inc/osapi-clock.h +++ b/src/os/inc/osapi-clock.h @@ -295,7 +295,7 @@ static inline OS_time_t OS_TimeFromTotalMicroseconds(int64 tm) * @sa OS_TimeFromTotalNanoseconds * * @param[in] tm Time interval value - * @returns Whole number of microseconds in time interval + * @returns Whole number of nanoseconds in time interval */ static inline int64 OS_TimeGetTotalNanoseconds(OS_time_t tm) { diff --git a/src/os/inc/osapi-condvar.h b/src/os/inc/osapi-condvar.h index aa1b4ab1f..79030a8f0 100644 --- a/src/os/inc/osapi-condvar.h +++ b/src/os/inc/osapi-condvar.h @@ -167,7 +167,7 @@ int32 OS_CondVarBroadcast(osal_id_t var_id); * The underlying mutex associated with the condition variable must be locked and * owned by the calling task at the time this function is invoked. As part of this * call, the mutex will be unlocked as the task blocks. This is done in such a way - * that there is no possibility that another task could aquire the mutex before the + * that there is no possibility that another task could acquire the mutex before the * calling task has actually blocked. * * This atomicity with respect to blocking the task and unlocking the mutex is a @@ -250,7 +250,7 @@ int32 OS_CondVarGetIdByName(osal_id_t *var_id, const char *var_name); * @return Execution status, see @ref OSReturnCodes * @retval #OS_SUCCESS @copybrief OS_SUCCESS * @retval #OS_ERR_INVALID_ID if the id passed in is not a valid semaphore - * @retval #OS_INVALID_POINTER if the mut_prop pointer is null + * @retval #OS_INVALID_POINTER if the condvar_prop pointer is null */ int32 OS_CondVarGetInfo(osal_id_t var_id, OS_condvar_prop_t *condvar_prop); /**@}*/ diff --git a/src/os/inc/osapi-countsem.h b/src/os/inc/osapi-countsem.h index 2670f5143..ce0529eef 100644 --- a/src/os/inc/osapi-countsem.h +++ b/src/os/inc/osapi-countsem.h @@ -63,7 +63,7 @@ typedef struct * * @return Execution status, see @ref OSReturnCodes * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_INVALID_POINTER if sen name or sem_id are NULL + * @retval #OS_INVALID_POINTER if sem_name or sem_id are NULL * @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME * @retval #OS_ERR_NO_FREE_IDS if all of the semaphore ids are taken * @retval #OS_ERR_NAME_TAKEN if this is already the name of a counting semaphore @@ -95,7 +95,7 @@ int32 OS_CountSemGive(osal_id_t sem_id); /** * @brief Decrement the semaphore value * - * The locks the semaphore referenced by sem_id by performing a + * This locks the semaphore referenced by sem_id by performing a * semaphore lock operation on that semaphore. If the semaphore value * is currently zero, then the calling thread shall not return from * the call until it either locks the semaphore or the call is @@ -155,7 +155,7 @@ int32 OS_CountSemDelete(osal_id_t sem_id); * * @return Execution status, see @ref OSReturnCodes * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_INVALID_POINTER is semid or sem_name are NULL pointers + * @retval #OS_INVALID_POINTER if sem_id or sem_name are NULL pointers * @retval #OS_ERR_NAME_TOO_LONG name length including null terminator greater than #OS_MAX_API_NAME * @retval #OS_ERR_NAME_NOT_FOUND if the name was not found in the table */ diff --git a/src/os/inc/osapi-sockets.h b/src/os/inc/osapi-sockets.h index 5a4dd3e6f..9adb5fa8a 100644 --- a/src/os/inc/osapi-sockets.h +++ b/src/os/inc/osapi-sockets.h @@ -25,7 +25,7 @@ #ifndef OSAPI_SOCKETS_H #define OSAPI_SOCKETS_H -/* NOTE - osconfig.h may optionally specify the value for OS_SOCADDR_MAX_LEN */ +/* NOTE - osconfig.h may optionally specify the value for OS_SOCKADDR_MAX_LEN */ #include "osconfig.h" #include "common_types.h" #include "osapi-clock.h" @@ -578,7 +578,7 @@ int32 OS_SocketGetIdByName(osal_id_t *sock_id, const char *sock_name); * * @return Execution status, see @ref OSReturnCodes * @retval #OS_SUCCESS @copybrief OS_SUCCESS - * @retval #OS_ERR_INVALID_ID if the id passed in is not a valid semaphore + * @retval #OS_ERR_INVALID_ID if the id passed in is not a valid socket * @retval #OS_INVALID_POINTER if the count_prop pointer is null */ int32 OS_SocketGetInfo(osal_id_t sock_id, OS_socket_prop_t *sock_prop); diff --git a/src/os/inc/osapi-timer.h b/src/os/inc/osapi-timer.h index eea4c5510..92da231dd 100644 --- a/src/os/inc/osapi-timer.h +++ b/src/os/inc/osapi-timer.h @@ -148,8 +148,8 @@ int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebas * zero to indicate the timer is not to be automatically reset. * * @note The resolution of the times specified is limited to the clock accuracy - * returned in the OS_TimerCreate call. If the times specified in the start_msec - * or interval_msec parameters are less than the accuracy, they will be rounded + * returned in the OS_TimerCreate call. If the times specified in the start_time + * or interval_time parameters are less than the accuracy, they will be rounded * up to the accuracy of the timer. * * @note This configuration API must not be used from the context of a timer callback. @@ -159,7 +159,7 @@ int32 OS_TimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_t timebas * @param[in] start_time Time in microseconds to the first expiration * @param[in] interval_time Time in microseconds between subsequent intervals, value * of zero will only call the user callback function once - * after the start_msec time. + * after the start_time time. * * @return Execution status, see @ref OSReturnCodes * @retval #OS_SUCCESS @copybrief OS_SUCCESS diff --git a/src/tests/idmap-api-test/idmap-api-test.c b/src/tests/idmap-api-test/idmap-api-test.c index e2ea90b2b..96ce3602d 100644 --- a/src/tests/idmap-api-test/idmap-api-test.c +++ b/src/tests/idmap-api-test/idmap-api-test.c @@ -323,13 +323,13 @@ void Test_OS_ForEachObject(void) /* Verify Outputs */ UtAssert_True(Count.TaskCount == 0, "OS_ForEachObject() TaskCount (%lu) == 0", (unsigned long)Count.TaskCount); - UtAssert_True(Count.QueueCount == 0, "OS_ForEachObject() QueueCount (%lu) == 1", (unsigned long)Count.QueueCount); - UtAssert_True(Count.CountSemCount == 0, "OS_ForEachObject() CountSemCount (%lu) == 1", + UtAssert_True(Count.QueueCount == 0, "OS_ForEachObject() QueueCount (%lu) == 0", (unsigned long)Count.QueueCount); + UtAssert_True(Count.CountSemCount == 0, "OS_ForEachObject() CountSemCount (%lu) == 0", (unsigned long)Count.CountSemCount); - UtAssert_True(Count.BinSemCount == 0, "OS_ForEachObject() BinSemCount (%lu) == 2", + UtAssert_True(Count.BinSemCount == 0, "OS_ForEachObject() BinSemCount (%lu) == 0", (unsigned long)Count.BinSemCount); UtAssert_True(Count.MutexCount == 3, "OS_ForEachObject() MutexCount (%lu) == 3", (unsigned long)Count.MutexCount); - UtAssert_True(Count.TimeBaseCount == 0, "OS_ForEachObject() TimeBaseCount (%lu) == 1", + UtAssert_True(Count.TimeBaseCount == 0, "OS_ForEachObject() TimeBaseCount (%lu) == 0", (unsigned long)Count.TimeBaseCount); /* diff --git a/src/tests/symbol-api-test/symbol-api-test.c b/src/tests/symbol-api-test/symbol-api-test.c index 78de352a2..1e2498861 100644 --- a/src/tests/symbol-api-test/symbol-api-test.c +++ b/src/tests/symbol-api-test/symbol-api-test.c @@ -55,7 +55,7 @@ void TestSymbolApi(void) } else if (status == OS_ERR_NAME_TOO_LONG) { - UtAssert_MIR("OS_SymbolTableDump name to long, consider increasing OSAL_CONFIG_MAX_SYM_LEN"); + UtAssert_MIR("OS_SymbolTableDump name too long, consider increasing OSAL_CONFIG_MAX_SYM_LEN"); } else { @@ -77,7 +77,7 @@ void TestSymbolApi(void) } else if (status == OS_ERR_NAME_TOO_LONG) { - UtAssert_MIR("OS_SymbolTableDump name to long, consider increasing OSAL_CONFIG_MAX_SYM_LEN"); + UtAssert_MIR("OS_SymbolTableDump name too long, consider increasing OSAL_CONFIG_MAX_SYM_LEN"); } else { @@ -99,7 +99,7 @@ void TestSymbolApi(void) } else if (status == OS_ERR_NAME_TOO_LONG) { - UtAssert_MIR("OS_SymbolTableDump name to long, consider increasing OSAL_CONFIG_MAX_SYM_LEN"); + UtAssert_MIR("OS_SymbolTableDump name too long, consider increasing OSAL_CONFIG_MAX_SYM_LEN"); } else { diff --git a/src/unit-test-coverage/shared/src/coveragetest-filesys.c b/src/unit-test-coverage/shared/src/coveragetest-filesys.c index 0815294ff..439715cdc 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-filesys.c +++ b/src/unit-test-coverage/shared/src/coveragetest-filesys.c @@ -319,12 +319,12 @@ void Test_OS_chkfs(void) expected = OS_INVALID_POINTER; actual = OS_chkfs(NULL, false); - UtAssert_True(actual == expected, "OS_fsBytesFree() (%ld) == OS_INVALID_POINTER", (long)actual); + UtAssert_True(actual == expected, "OS_chkfs() (%ld) == OS_INVALID_POINTER", (long)actual); UT_SetDefaultReturnValue(UT_KEY(OCS_memchr), OS_ERROR); expected = OS_FS_ERR_PATH_TOO_LONG; actual = OS_chkfs("/cf", false); - UtAssert_True(actual == expected, "OS_fsBytesFree() (%ld) == OS_FS_ERR_PATH_TOO_LONG", (long)actual); + UtAssert_True(actual == expected, "OS_chkfs() (%ld) == OS_FS_ERR_PATH_TOO_LONG", (long)actual); UT_ClearDefaultReturnValue(UT_KEY(OCS_memchr)); /* Test Fail due to no matching VolTab entry */ diff --git a/src/unit-test-coverage/shared/src/coveragetest-idmap.c b/src/unit-test-coverage/shared/src/coveragetest-idmap.c index 1b8f8ea8a..72a94de29 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-idmap.c +++ b/src/unit-test-coverage/shared/src/coveragetest-idmap.c @@ -1041,7 +1041,7 @@ void Test_OS_ForEachObject(void) UtAssert_True(Count.TaskCount == 1, "OS_ForEachObject() TaskCount (%lu) == 1", (unsigned long)Count.TaskCount); UtAssert_True(Count.QueueCount == 1, "OS_ForEachObject() QueueCount (%lu) == 1", (unsigned long)Count.QueueCount); UtAssert_True(Count.MutexCount == 1, "OS_ForEachObject() MutexCount (%lu) == 1", (unsigned long)Count.MutexCount); - UtAssert_True(Count.OtherCount == 10, "OS_ForEachObject() OtherCount (%lu) == 9", (unsigned long)Count.OtherCount); + UtAssert_True(Count.OtherCount == 10, "OS_ForEachObject() OtherCount (%lu) == 10", (unsigned long)Count.OtherCount); OS_ForEachObjectOfType(OS_OBJECT_TYPE_OS_QUEUE, self_id.id, ObjTypeCounter, &Count); UtAssert_True(Count.TaskCount == 1, "OS_ForEachObjectOfType(), creator %08lx TaskCount (%lu) == 1", diff --git a/src/unit-tests/oscore-test/ut_oscore_select_test.c b/src/unit-tests/oscore-test/ut_oscore_select_test.c index 7dbbdae83..a6a0ef96f 100644 --- a/src/unit-tests/oscore-test/ut_oscore_select_test.c +++ b/src/unit-tests/oscore-test/ut_oscore_select_test.c @@ -182,5 +182,5 @@ void UT_os_select_multi_test(void) } /*================================================================================* -** End of File: ut_oscore_queue_test.c +** End of File: ut_oscore_select_test.c **================================================================================*/ diff --git a/src/unit-tests/osfile-test/ut_osfile_fileio_test.c b/src/unit-tests/osfile-test/ut_osfile_fileio_test.c index 9a8050228..5ba14575d 100644 --- a/src/unit-tests/osfile-test/ut_osfile_fileio_test.c +++ b/src/unit-tests/osfile-test/ut_osfile_fileio_test.c @@ -1350,7 +1350,7 @@ void UT_os_movefile_test() /* #6 Nominal */ memset(g_fNames[0], '\0', sizeof(g_fNames[0])); - memset(g_fNames[0], '\0', sizeof(g_fNames[1])); + memset(g_fNames[1], '\0', sizeof(g_fNames[1])); UT_os_sprintf(g_fNames[0], "%s/Mv_Nom_Old.txt", g_mntName); UT_os_sprintf(g_fNames[1], "%s/Mv_Nom_New.txt", g_mntName);