From 22f9d42b0875eb91bb814e567011a62d16917918 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 17 Mar 2021 11:58:09 -0400 Subject: [PATCH] Fix #1180, Remove impossible conditions --- modules/es/fsw/src/cfe_es_apps.c | 65 ++++++++++++-------------- modules/tbl/fsw/src/cfe_tbl_internal.c | 2 +- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 4a5e14740..9855a90c2 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -1285,42 +1285,39 @@ void CFE_ES_ProcessControlRequest(CFE_ES_AppId_t AppId) break; } - if (EventID != 0 && ReqName != NULL) + if (MessageDetail[0] != 0) { - if (MessageDetail[0] != 0) - { - /* Detail message already set, assume it is an error event */ - EventType = CFE_EVS_EventType_ERROR; - } - else if (StartupStatus != CFE_SUCCESS) - { - /* Make detail message for event containing startup error code */ - EventType = CFE_EVS_EventType_ERROR; - snprintf(MessageDetail, sizeof(MessageDetail), "Failed: AppCreate Error 0x%08X.", - (unsigned int)StartupStatus); - } - else if (CleanupStatus != CFE_SUCCESS) - { - /* Make detail message for event containing cleanup error code */ - EventType = CFE_EVS_EventType_ERROR; - snprintf(MessageDetail, sizeof(MessageDetail), "Failed: CleanUpApp Error 0x%08X.", - (unsigned int)CleanupStatus); - } - else if (CFE_RESOURCEID_TEST_DEFINED(NewAppId)) - { - /* Record success message for event where app is restarted */ - EventType = CFE_EVS_EventType_INFORMATION; - snprintf(MessageDetail, sizeof(MessageDetail), "Completed, AppID=%lu", CFE_RESOURCEID_TO_ULONG(NewAppId)); - } - else - { - /* Record success message for event */ - EventType = CFE_EVS_EventType_INFORMATION; - snprintf(MessageDetail, sizeof(MessageDetail), "Completed."); - } - - CFE_EVS_SendEvent(EventID, EventType, "%s Application %s %s", ReqName, OrigAppName, MessageDetail); + /* Detail message already set, assume it is an error event */ + EventType = CFE_EVS_EventType_ERROR; + } + else if (StartupStatus != CFE_SUCCESS) + { + /* Make detail message for event containing startup error code */ + EventType = CFE_EVS_EventType_ERROR; + snprintf(MessageDetail, sizeof(MessageDetail), "Failed: AppCreate Error 0x%08X.", + (unsigned int)StartupStatus); } + else if (CleanupStatus != CFE_SUCCESS) + { + /* Make detail message for event containing cleanup error code */ + EventType = CFE_EVS_EventType_ERROR; + snprintf(MessageDetail, sizeof(MessageDetail), "Failed: CleanUpApp Error 0x%08X.", + (unsigned int)CleanupStatus); + } + else if (CFE_RESOURCEID_TEST_DEFINED(NewAppId)) + { + /* Record success message for event where app is restarted */ + EventType = CFE_EVS_EventType_INFORMATION; + snprintf(MessageDetail, sizeof(MessageDetail), "Completed, AppID=%lu", CFE_RESOURCEID_TO_ULONG(NewAppId)); + } + else + { + /* Record success message for event */ + EventType = CFE_EVS_EventType_INFORMATION; + snprintf(MessageDetail, sizeof(MessageDetail), "Completed."); + } + + CFE_EVS_SendEvent(EventID, EventType, "%s Application %s %s", ReqName, OrigAppName, MessageDetail); } /* End Function */ diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index df6045b8d..4b1a4050b 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -145,7 +145,7 @@ int32 CFE_TBL_EarlyInit(void) } j++; - } while ((j < CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS) && (Status >= CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE)); + } while (j < CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS); } /* Try to obtain a previous image of the Critical Table Registry from the Critical Data Store */