Skip to content

Commit

Permalink
Fix #54, Combine multiple unnecessary status/result variables
Browse files Browse the repository at this point in the history
  • Loading branch information
thnkslprpt committed May 18, 2023
1 parent a6abfff commit 258a9b0
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions fsw/src/md_dwell_tbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,16 +337,14 @@ CFE_Status_t MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue)
{
CFE_Status_t Status = CFE_SUCCESS;
MD_DwellTableLoad_t *MD_LoadTablePtr = NULL;
CFE_Status_t GetAddressResult;

GetAddressResult = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);
Status = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);

if ((GetAddressResult != CFE_SUCCESS) && (GetAddressResult != CFE_TBL_INFO_UPDATED))
if ((Status != CFE_SUCCESS) && (Status != CFE_TBL_INFO_UPDATED))
{
CFE_EVS_SendEvent(MD_UPDATE_TBL_EN_ERR_EID, CFE_EVS_EventType_ERROR,
"MD_UpdateTableEnabledField, TableIndex %d: CFE_TBL_GetAddress Returned 0x%08x", TableIndex,
GetAddressResult);
Status = GetAddressResult;
Status);
}
else
{
Expand All @@ -367,20 +365,18 @@ CFE_Status_t MD_UpdateTableEnabledField(uint16 TableIndex, uint16 FieldValue)
CFE_Status_t MD_UpdateTableDwellEntry(uint16 TableIndex, uint16 EntryIndex, uint16 NewLength, uint16 NewDelay,
MD_SymAddr_t NewDwellAddress)
{
CFE_Status_t Status = CFE_SUCCESS;
CFE_Status_t GetAddressResult = 0;
MD_DwellTableLoad_t *MD_LoadTablePtr = NULL;
MD_TableLoadEntry_t *EntryPtr = NULL;
CFE_Status_t Status = CFE_SUCCESS;
MD_DwellTableLoad_t *MD_LoadTablePtr = NULL;
MD_TableLoadEntry_t *EntryPtr = NULL;bles)

/* Get pointer to Table */
GetAddressResult = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);
Status = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);

if ((GetAddressResult != CFE_SUCCESS) && (GetAddressResult != CFE_TBL_INFO_UPDATED))
if ((Status != CFE_SUCCESS) && (Status != CFE_TBL_INFO_UPDATED))
{
CFE_EVS_SendEvent(MD_UPDATE_TBL_DWELL_ERR_EID, CFE_EVS_EventType_ERROR,
"MD_UpdateTableDwellEntry, TableIndex %d: CFE_TBL_GetAddress Returned 0x%08x", TableIndex,
GetAddressResult);
Status = GetAddressResult;
Status);
}
else
{
Expand Down Expand Up @@ -417,17 +413,15 @@ CFE_Status_t MD_UpdateTableSignature(uint16 TableIndex, char NewSignature[MD_SIG
{
CFE_Status_t Status = CFE_SUCCESS;
MD_DwellTableLoad_t *MD_LoadTablePtr = NULL;
CFE_Status_t GetAddressResult;

/* Get pointer to Table */
GetAddressResult = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);
Status = CFE_TBL_GetAddress((void *)&MD_LoadTablePtr, MD_AppData.MD_TableHandle[TableIndex]);

if ((GetAddressResult != CFE_SUCCESS) && (GetAddressResult != CFE_TBL_INFO_UPDATED))
if ((Status != CFE_SUCCESS) && (Status != CFE_TBL_INFO_UPDATED))
{
CFE_EVS_SendEvent(MD_UPDATE_TBL_SIG_ERR_EID, CFE_EVS_EventType_ERROR,
"MD_UpdateTableSignature, TableIndex %d: CFE_TBL_GetAddress Returned 0x%08x", TableIndex,
GetAddressResult);
Status = GetAddressResult;
Status);
}
else
{
Expand Down

0 comments on commit 258a9b0

Please sign in to comment.