From 4a77997f95f74ec1960edf2344f4515bf27cbdb3 Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Fri, 22 Jan 2021 09:24:22 -0500 Subject: [PATCH] Fix #742, remove null checks from internal methods. --- src/os/shared/src/osapi-common.c | 9 -- src/os/shared/src/osapi-debug.c | 4 - src/os/shared/src/osapi-filesys.c | 15 +-- src/os/shared/src/osapi-idmap.c | 115 +++--------------- src/os/shared/src/osapi-module.c | 11 -- src/os/shared/src/osapi-printf.c | 8 +- src/os/shared/src/osapi-select.c | 8 +- src/os/shared/src/osapi-sockets.c | 12 +- src/os/shared/src/osapi-task.c | 11 +- src/os/shared/src/osapi-time.c | 8 +- src/os/shared/src/osapi-timebase.c | 3 - .../shared/src/coveragetest-idmap.c | 5 - 12 files changed, 36 insertions(+), 173 deletions(-) diff --git a/src/os/shared/src/osapi-common.c b/src/os/shared/src/osapi-common.c index e2832d6cd..62a5a433b 100644 --- a/src/os/shared/src/osapi-common.c +++ b/src/os/shared/src/osapi-common.c @@ -80,12 +80,6 @@ int32 OS_NotifyEvent(OS_Event_t event, osal_id_t object_id, void *data) { int32 status; - /* - * Check parameters - * - * Note "data" is not checked, because in certain configurations it can be validly null. - */ - if (OS_SharedGlobalVars.EventHandler != NULL) { status = OS_SharedGlobalVars.EventHandler(event, object_id, data); @@ -282,9 +276,6 @@ void OS_CleanUpObject(osal_id_t object_id, void *arg) { uint32 *ObjectCount; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(arg); - ObjectCount = (uint32 *)arg; ++(*ObjectCount); switch (OS_IdentifyObject(object_id)) diff --git a/src/os/shared/src/osapi-debug.c b/src/os/shared/src/osapi-debug.c index cd1b31c9d..f6eef77ac 100644 --- a/src/os/shared/src/osapi-debug.c +++ b/src/os/shared/src/osapi-debug.c @@ -55,10 +55,6 @@ void OS_DebugPrintf(uint32 Level, const char *Func, uint32 Line, const char *For { va_list va; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(Func); - //OS_CHECK_POINTER(Format); - if (OS_SharedGlobalVars.DebugLevel >= Level) { va_start(va, Format); diff --git a/src/os/shared/src/osapi-filesys.c b/src/os/shared/src/osapi-filesys.c index e75bcbce9..8d1b44c7e 100644 --- a/src/os/shared/src/osapi-filesys.c +++ b/src/os/shared/src/osapi-filesys.c @@ -75,9 +75,6 @@ const char OS_FILESYS_RAMDISK_VOLNAME_PREFIX[] = "RAM"; *-----------------------------------------------------------------*/ bool OS_FileSysFilterFree(void *ref, const OS_object_token_t *token, const OS_common_record_t *obj) { - /* Check parameters */ - OS_CHECK_POINTER(obj); - return !OS_ObjectIdDefined(obj->active_id); } @@ -94,10 +91,6 @@ bool OS_FileSysFilterFree(void *ref, const OS_object_token_t *token, const OS_co *-----------------------------------------------------------------*/ bool OS_FileSys_FindVirtMountPoint(void *ref, const OS_object_token_t *token, const OS_common_record_t *obj) { - /* Check parameters */ - OS_CHECK_POINTER(ref); - OS_CHECK_POINTER(token); - OS_filesys_internal_record_t *filesys; const char * target = (const char *)ref; size_t mplen; @@ -133,10 +126,10 @@ int32 OS_FileSys_Initialize(char *address, const char *fsdevname, const char *fs OS_object_token_t token; /* - * Check parameters - * - * Note "address" is not checked, because in certain configurations it can be validly null. - */ + * Check parameters + * + * Note "address" is not checked, because in certain configurations it can be validly null. + */ OS_CHECK_STRING(fsdevname, sizeof(filesys->device_name), OS_FS_ERR_PATH_TOO_LONG); OS_CHECK_STRING(fsvolname, sizeof(filesys->volume_name), OS_FS_ERR_PATH_TOO_LONG); diff --git a/src/os/shared/src/osapi-idmap.c b/src/os/shared/src/osapi-idmap.c index b9aba03bd..d6e16791e 100644 --- a/src/os/shared/src/osapi-idmap.c +++ b/src/os/shared/src/osapi-idmap.c @@ -91,7 +91,6 @@ typedef struct void * user_arg; } OS_creator_filter_t; - /* * Global ID storage tables */ @@ -243,11 +242,7 @@ uint32 OS_GetBaseForObjectType(osal_objtype_t idtype) *-----------------------------------------------------------------*/ bool OS_ForEachFilterCreator(void *ref, const OS_object_token_t *token, const OS_common_record_t *obj) { - /* Check parameters */ - OS_CHECK_POINTER(ref); - OS_CHECK_POINTER(obj); - - OS_creator_filter_t *filter = ref; + OS_creator_filter_t *filter = ref; /* * Check if the obj_id is both valid and matches @@ -267,9 +262,6 @@ bool OS_ForEachFilterCreator(void *ref, const OS_object_token_t *token, const OS *-----------------------------------------------------------------*/ int32 OS_ForEachDoCallback(osal_id_t obj_id, void *ref) { - /* Check parameters */ - OS_CHECK_POINTER(ref); - OS_creator_filter_t *filter = ref; /* Just invoke the user callback */ @@ -277,7 +269,6 @@ int32 OS_ForEachDoCallback(osal_id_t obj_id, void *ref) return OS_SUCCESS; } - /*---------------------------------------------------------------- * * Function: OS_ObjectIdGlobalFromToken @@ -290,9 +281,6 @@ int32 OS_ForEachDoCallback(osal_id_t obj_id, void *ref) *-----------------------------------------------------------------*/ OS_common_record_t *OS_ObjectIdGlobalFromToken(const OS_object_token_t *token) { - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(token); - uint32 base_idx = OS_GetBaseForObjectType(token->obj_type); return &OS_common_table[base_idx + token->obj_idx]; } @@ -313,11 +301,6 @@ OS_common_record_t *OS_ObjectIdGlobalFromToken(const OS_object_token_t *token) *-----------------------------------------------------------------*/ bool OS_ObjectNameMatch(void *ref, const OS_object_token_t *token, const OS_common_record_t *obj) { - /* Check parameters */ - OS_CHECK_POINTER(ref); - OS_CHECK_POINTER(token); - OS_CHECK_POINTER(obj); - return (obj->name_entry != NULL && strcmp((const char *)ref, obj->name_entry) == 0); } /* end OS_ObjectNameMatch */ @@ -339,9 +322,6 @@ bool OS_ObjectNameMatch(void *ref, const OS_object_token_t *token, const OS_comm *-----------------------------------------------------------------*/ int32 OS_ObjectIdTransactionInit(OS_lock_mode_t lock_mode, osal_objtype_t idtype, OS_object_token_t *token) { - /* Check parameters */ - OS_CHECK_POINTER(token); - memset(token, 0, sizeof(*token)); if (OS_SharedGlobalVars.Initialized == false) @@ -390,9 +370,6 @@ int32 OS_ObjectIdTransactionInit(OS_lock_mode_t lock_mode, osal_objtype_t idtype *-----------------------------------------------------------------*/ void OS_ObjectIdTransactionCancel(OS_object_token_t *token) { - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(token); - if (token->lock_mode != OS_LOCK_MODE_NONE) { OS_Unlock_Global(token); @@ -445,9 +422,6 @@ int32 OS_ObjectIdConvertToken(OS_object_token_t *token) OS_common_record_t *obj; osal_id_t expected_id; - /* Check parameters */ - OS_CHECK_POINTER(token); - obj = OS_ObjectIdGlobalFromToken(token); expected_id = OS_ObjectIdFromToken(token); @@ -607,13 +581,6 @@ int32 OS_ObjectIdFindNextMatch(OS_ObjectMatchFunc_t MatchFunc, void *arg, OS_obj OS_common_record_t *base; OS_common_record_t *record; - /* - * Check parameters - * - * Note "arg" is not checked, because in certain configurations it can be validly null. - */ - OS_CHECK_POINTER(token); - return_code = OS_ERR_NAME_NOT_FOUND; base = &OS_common_table[OS_GetBaseForObjectType(token->obj_type)]; obj_count = OS_GetMaxForObjectType(token->obj_type); @@ -669,9 +636,6 @@ int32 OS_ObjectIdFindNextFree(OS_object_token_t *token) OS_common_record_t *obj = NULL; OS_objtype_state_t *objtype_state; - /* Check parameters */ - OS_CHECK_POINTER(token); - base_id = OS_GetBaseForObjectType(token->obj_type); max_id = OS_GetMaxForObjectType(token->obj_type); objtype_state = &OS_objtype_state[token->obj_type]; @@ -750,9 +714,6 @@ void OS_Lock_Global(OS_object_token_t *token) osal_id_t self_task_id; OS_objtype_state_t *objtype; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(token); - if (token->obj_type < OS_OBJECT_TYPE_USER && token->lock_mode != OS_LOCK_MODE_NONE) { objtype = &OS_objtype_state[token->obj_type]; @@ -784,16 +745,17 @@ void OS_Lock_Global(OS_object_token_t *token) * This makes it different for every operation, and different depending * on what task is calling the function. */ - token->lock_key.key_value = OS_LOCK_KEY_FIXED_VALUE | - ((OS_ObjectIdToInteger(self_task_id) ^ objtype->transaction_count) & 0xFFFFFF); + token->lock_key.key_value = + OS_LOCK_KEY_FIXED_VALUE | ((OS_ObjectIdToInteger(self_task_id) ^ objtype->transaction_count) & 0xFFFFFF); ++objtype->transaction_count; if (objtype->owner_key.key_value != 0) { /* this is almost certainly a bug */ - OS_DEBUG("ERROR: global %u acquired by task 0x%lx when already assigned key 0x%lx\n", (unsigned int)token->obj_type, - OS_ObjectIdToInteger(self_task_id), (unsigned long)objtype->owner_key.key_value); + OS_DEBUG("ERROR: global %u acquired by task 0x%lx when already assigned key 0x%lx\n", + (unsigned int)token->obj_type, OS_ObjectIdToInteger(self_task_id), + (unsigned long)objtype->owner_key.key_value); } else { @@ -802,8 +764,8 @@ void OS_Lock_Global(OS_object_token_t *token) } else { - OS_DEBUG("ERROR: cannot lock global %u for mode %u\n", - (unsigned int)token->obj_type, (unsigned int)token->lock_mode); + OS_DEBUG("ERROR: cannot lock global %u for mode %u\n", (unsigned int)token->obj_type, + (unsigned int)token->lock_mode); } } @@ -816,9 +778,6 @@ void OS_Unlock_Global(OS_object_token_t *token) { OS_objtype_state_t *objtype; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(token); - if (token->obj_type < OS_OBJECT_TYPE_USER && token->lock_mode != OS_LOCK_MODE_NONE) { objtype = &OS_objtype_state[token->obj_type]; @@ -835,8 +794,9 @@ void OS_Unlock_Global(OS_object_token_t *token) objtype->owner_key.key_value != token->lock_key.key_value) { /* this is almost certainly a bug */ - OS_DEBUG("ERROR: global %u released using mismatched key=0x%lx expected=0x%lx\n", (unsigned int)token->obj_type, - (unsigned long)token->lock_key.key_value, (unsigned long)objtype->owner_key.key_value); + OS_DEBUG("ERROR: global %u released using mismatched key=0x%lx expected=0x%lx\n", + (unsigned int)token->obj_type, (unsigned long)token->lock_key.key_value, + (unsigned long)objtype->owner_key.key_value); } objtype->owner_key = OS_LOCK_KEY_INVALID; @@ -846,8 +806,8 @@ void OS_Unlock_Global(OS_object_token_t *token) } else { - OS_DEBUG("ERROR: cannot unlock global %u for mode %u\n", - (unsigned int)token->obj_type, (unsigned int)token->lock_mode); + OS_DEBUG("ERROR: cannot unlock global %u for mode %u\n", (unsigned int)token->obj_type, + (unsigned int)token->lock_mode); } } @@ -867,9 +827,6 @@ void OS_WaitForStateChange(OS_object_token_t *token, uint32 attempts) osal_key_t saved_unlock_key; OS_objtype_state_t *objtype; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(token); - /* * This needs to release the lock, to allow other * tasks to make a change to the table. But to avoid @@ -919,13 +876,6 @@ int32 OS_ObjectIdFinalizeNew(int32 operation_status, OS_object_token_t *token, o { osal_id_t final_id; - /* - * Check parameters - * - * Note "outid" is not checked, because in certain configurations it can be validly null. - */ - OS_CHECK_POINTER(token); - /* if operation was unsuccessful, then clear * the active_id field within the record, so * the record can be re-used later. @@ -970,9 +920,6 @@ int32 OS_ObjectIdFinalizeDelete(int32 operation_status, OS_object_token_t *token { osal_id_t final_id; - /* Check parameters */ - OS_CHECK_POINTER(token); - /* Clear the OSAL ID if successful - this returns the record to the pool */ if (operation_status == OS_SUCCESS) { @@ -1072,9 +1019,6 @@ int32 OS_ObjectIdFindByName(osal_objtype_t idtype, const char *name, osal_id_t * int32 return_code; OS_object_token_t token; - /* Check parameters */ - OS_CHECK_POINTER(object_id); - /* * As this is an internal-only function, calling it will NULL is allowed. * This is required by the file/dir/socket API since these DO allow multiple @@ -1163,14 +1107,6 @@ void OS_ObjectIdTransactionFinish(OS_object_token_t *token, osal_id_t *final_id) { OS_common_record_t *record; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - /* - * Check parameters - * - * Note "final_id" is not checked, because in certain configurations it can be validly null. - */ - //OS_CHECK_POINTER(token); - if (token->lock_mode == OS_LOCK_MODE_NONE) { /* nothing to do */ @@ -1342,10 +1278,6 @@ int32 OS_ObjectIdAllocateNew(osal_objtype_t idtype, const char *name, OS_object_ ------------------------------------------------------------------*/ void OS_ObjectIdTransferToken(OS_object_token_t *token_from, OS_object_token_t *token_to) { - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(token_to); - //OS_CHECK_POINTER(token_from); - /* start with a simple copy */ *token_to = *token_from; @@ -1365,13 +1297,6 @@ void OS_ObjectIdTransferToken(OS_object_token_t *token_from, OS_object_token_t * int32 OS_ObjectIdIteratorInit(OS_ObjectMatchFunc_t matchfunc, void *matcharg, osal_objtype_t objtype, OS_object_iter_t *iter) { - /* - * Check parameters - * - * Note "matcharg" is not checked, because in certain configurations it can be validly null. - */ - OS_CHECK_POINTER(iter); - iter->match = matchfunc; iter->arg = matcharg; iter->limit = OS_GetMaxForObjectType(objtype); @@ -1387,9 +1312,6 @@ int32 OS_ObjectIdIteratorInit(OS_ObjectMatchFunc_t matchfunc, void *matcharg, os ------------------------------------------------------------------*/ bool OS_ObjectFilterActive(void *ref, const OS_object_token_t *token, const OS_common_record_t *obj) { - /* Check parameters */ - OS_CHECK_POINTER(obj); - return OS_ObjectIdDefined(obj->active_id); } @@ -1412,8 +1334,6 @@ bool OS_ObjectIdIteratorGetNext(OS_object_iter_t *iter) { OS_common_record_t *record; bool got_next; - - OS_CHECK_POINTER(iter); got_next = false; iter->token.obj_id = OS_OBJECT_ID_UNDEFINED; @@ -1456,10 +1376,6 @@ int32 OS_ObjectIdIteratorProcessEntry(OS_object_iter_t *iter, int32 (*func)(osal { int32 status; - /* Check parameters */ - OS_CHECK_POINTER(iter); - OS_CHECK_POINTER(func); - /* * This needs to temporarily unlock the global, * call the handler function, then re-lock. @@ -1517,13 +1433,14 @@ void OS_ForEachObject(osal_id_t creator_id, OS_ArgCallback_t callback_ptr, void * See description in API and header file for detail * *-----------------------------------------------------------------*/ -void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr, void *callback_arg) +void OS_ForEachObjectOfType(osal_objtype_t idtype, osal_id_t creator_id, OS_ArgCallback_t callback_ptr, + void *callback_arg) { OS_object_iter_t iter; OS_creator_filter_t filter; /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(callback_arg) + // OS_CHECK_POINTER(callback_arg) filter.creator_id = creator_id; filter.user_callback = callback_ptr; diff --git a/src/os/shared/src/osapi-module.c b/src/os/shared/src/osapi-module.c index 96c5d5835..18b6eef26 100644 --- a/src/os/shared/src/osapi-module.c +++ b/src/os/shared/src/osapi-module.c @@ -101,14 +101,6 @@ int32 OS_SymbolLookup_Static(cpuaddr *SymbolAddress, const char *SymbolName, con int32 return_code = OS_ERR_NOT_IMPLEMENTED; OS_static_symbol_record_t *StaticSym = OS_STATIC_SYMTABLE_SOURCE; - /* - * Check parameters - * - * Note "ModuleName" is not checked, because in certain configurations it can be validly null. - */ - OS_CHECK_POINTER(SymbolAddress); - OS_CHECK_POINTER(SymbolName); - while (StaticSym != NULL) { if (StaticSym->Name == NULL) @@ -147,9 +139,6 @@ int32 OS_ModuleLoad_Static(const char *ModuleName) int32 return_code = OS_ERR_NAME_NOT_FOUND; OS_static_symbol_record_t *StaticSym = OS_STATIC_SYMTABLE_SOURCE; - /* Check parameters */ - OS_CHECK_POINTER(ModuleName); - while (StaticSym != NULL) { if (StaticSym->Name == NULL) diff --git a/src/os/shared/src/osapi-printf.c b/src/os/shared/src/osapi-printf.c index 4ed98e732..a6879f986 100644 --- a/src/os/shared/src/osapi-printf.c +++ b/src/os/shared/src/osapi-printf.c @@ -142,12 +142,6 @@ static int32 OS_Console_CopyOut(OS_console_internal_record_t *console, const cha size_t WriteOffset; int32 return_code; - /* Check parameters */ - OS_CHECK_POINTER(console); - OS_CHECK_POINTER(Str); - OS_CHECK_POINTER(NextWritePos); - - return_code = OS_ERROR; pmsg = Str; WriteOffset = *NextWritePos; @@ -263,7 +257,7 @@ void OS_printf(const char *String, ...) int actualsz; /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(String); + // OS_CHECK_POINTER(String); if (!OS_SharedGlobalVars.Initialized) { diff --git a/src/os/shared/src/osapi-select.c b/src/os/shared/src/osapi-select.c index 3158ebbc3..f74453366 100644 --- a/src/os/shared/src/osapi-select.c +++ b/src/os/shared/src/osapi-select.c @@ -90,10 +90,10 @@ int32 OS_SelectMultiple(OS_FdSet *ReadSet, OS_FdSet *WriteSet, int32 msecs) int32 return_code; /* - * Check parameters - * - * Note "ReadSet" and "WriteSet" are not checked, because in certain configurations they can be validly null. - */ + * Check parameters + * + * Note "ReadSet" and "WriteSet" are not checked, because in certain configurations they can be validly null. + */ /* * This does not currently increment any refcounts. diff --git a/src/os/shared/src/osapi-sockets.c b/src/os/shared/src/osapi-sockets.c index 66f2aeae5..ddfdd44ab 100644 --- a/src/os/shared/src/osapi-sockets.c +++ b/src/os/shared/src/osapi-sockets.c @@ -96,10 +96,6 @@ void OS_CreateSocketName(const OS_object_token_t *token, const OS_SockAddr_t *Ad uint16 port; OS_stream_internal_record_t *sock; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(token); - //OS_CHECK_POINTER(Addr); - sock = OS_OBJECT_TABLE_GET(OS_stream_table, *token); if (OS_SocketAddrToString_Impl(sock->stream_name, OS_MAX_API_NAME, Addr) != OS_SUCCESS) @@ -364,10 +360,10 @@ int32 OS_SocketRecvFrom(osal_id_t sock_id, void *buffer, size_t buflen, OS_SockA int32 return_code; /* - * Check parameters - * - * Note "RemoteAddr" is not checked, because in certain configurations it can be validly null. - */ + * Check parameters + * + * Note "RemoteAddr" is not checked, because in certain configurations it can be validly null. + */ OS_CHECK_POINTER(buffer); OS_CHECK_SIZE(buflen); diff --git a/src/os/shared/src/osapi-task.c b/src/os/shared/src/osapi-task.c index 2cfa88aba..29c60dd4f 100644 --- a/src/os/shared/src/osapi-task.c +++ b/src/os/shared/src/osapi-task.c @@ -85,9 +85,6 @@ static int32 OS_TaskPrepare(osal_id_t task_id, osal_task_entry *entrypt) OS_object_token_t token; OS_task_internal_record_t *task; - /* Check parameters */ - OS_CHECK_POINTER(entrypt); - return_code = OS_ObjectIdGetById(OS_LOCK_MODE_GLOBAL, OS_OBJECT_TYPE_OS_TASK, task_id, &token); if (return_code == OS_SUCCESS) { @@ -182,10 +179,10 @@ int32 OS_TaskCreate(osal_id_t *task_id, const char *task_name, osal_task_entry f OS_task_internal_record_t *task; /* - * Check parameters - * - * Note "stack_pointer" is not checked, because in certain configurations it can be validly null. - */ + * Check parameters + * + * Note "stack_pointer" is not checked, because in certain configurations it can be validly null. + */ OS_CHECK_POINTER(task_id); OS_CHECK_POINTER(function_pointer); OS_CHECK_APINAME(task_name); diff --git a/src/os/shared/src/osapi-time.c b/src/os/shared/src/osapi-time.c index 0400873de..fd834944f 100644 --- a/src/os/shared/src/osapi-time.c +++ b/src/os/shared/src/osapi-time.c @@ -106,12 +106,13 @@ static int32 OS_DoTimerAdd(osal_id_t *timer_id, const char *timer_name, osal_id_ OS_timebase_internal_record_t *timebase; /* - ** Check Parameters + * Check parameters + * + * Note "callback_arg" is not checked, because in certain configurations it can be validly null. */ OS_CHECK_POINTER(timer_id); OS_CHECK_APINAME(timer_name); OS_CHECK_POINTER(callback_ptr); - OS_CHECK_POINTER(callback_arg); /* * Check our context. Not allowed to use the timer API from a timer callback. @@ -219,9 +220,6 @@ static void OS_Timer_NoArgCallback(osal_id_t objid, void *arg) { OS_Timer_ArgWrapper_t Conv; - /* TODO: void pointer, https://github.com/nasa/osal/issues/765 */ - //OS_CHECK_POINTER(arg); - /* * Note - did not write this as simply *((OS_SimpleCallback_t)arg) because * technically you cannot cast a void * to a function pointer. diff --git a/src/os/shared/src/osapi-timebase.c b/src/os/shared/src/osapi-timebase.c index f922b2630..219f3e549 100644 --- a/src/os/shared/src/osapi-timebase.c +++ b/src/os/shared/src/osapi-timebase.c @@ -540,9 +540,6 @@ int32 OS_Milli2Ticks(uint32 milli_seconds, int *ticks) uint64 num_of_ticks; int32 return_code = OS_SUCCESS; - /* Check parameters */ - OS_CHECK_POINTER(ticks); - num_of_ticks = (((uint64)milli_seconds * OS_SharedGlobalVars.TicksPerSecond) + 999) / 1000; /* Check against maximum int32 (limit from some OS's) */ diff --git a/src/unit-test-coverage/shared/src/coveragetest-idmap.c b/src/unit-test-coverage/shared/src/coveragetest-idmap.c index 440d852c8..ee8270dd8 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-idmap.c +++ b/src/unit-test-coverage/shared/src/coveragetest-idmap.c @@ -432,11 +432,6 @@ void Test_OS_ObjectIdFindByName(void) int32 actual = OS_ObjectIdFindByName(OS_OBJECT_TYPE_UNDEFINED, NULL, &objid); UtAssert_True(actual == expected, "OS_ObjectFindIdByName(%s) (%ld) == OS_ERR_NAME_NOT_FOUND", "NULL", (long)actual); - expected = OS_INVALID_POINTER; - actual = OS_ObjectIdFindByName(OS_OBJECT_TYPE_UNDEFINED, TaskName, NULL); - UtAssert_True(actual == expected, "OS_ObjectFindIdByName(%s) (%ld) == OS_INVALID_POINTER", "NULL", (long)actual); - - /* * Pass in a name that is beyond OS_MAX_API_NAME */