Skip to content

Commit fff5114

Browse files
authored
Merge pull request #104 from thnkslprpt/fix-103-remove-redundant-Result-variable-in-CS_ComputeApp
Fix #103, Simplify `CS_ComputeApp` by removing redundant `Result` variable
2 parents f958cc0 + cef2995 commit fff5114

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

fsw/src/cs_compute.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,9 @@ CFE_Status_t CS_ComputeApp(CS_Res_App_Table_Entry_t *ResultsEntry, uint32 *Compu
312312
int32 NumBytesRemainingCycles = 0;
313313
uint32 NewChecksumValue = 0;
314314
CFE_Status_t Status = CFE_SUCCESS;
315-
CFE_Status_t Result;
316-
CFE_Status_t ResultGetResourceID = CS_ERROR;
317-
CFE_Status_t ResultGetResourceInfo = CS_ERROR;
318-
bool ResultAddressValid = false;
315+
CFE_Status_t ResultGetResourceID = CS_ERROR;
316+
CFE_Status_t ResultGetResourceInfo = CS_ERROR;
317+
bool ResultAddressValid = false;
319318

320319
/* variables to get applications address */
321320
CFE_ResourceId_t ResourceID = CFE_RESOURCEID_UNDEFINED;
@@ -332,37 +331,34 @@ CFE_Status_t CS_ComputeApp(CS_Res_App_Table_Entry_t *ResultsEntry, uint32 *Compu
332331
/* Also check for a matching library name */
333332
ResultGetResourceID = CFE_ES_GetLibIDByName((CFE_ES_LibId_t *)&ResourceID, ResultsEntry->Name);
334333
}
335-
Result = ResultGetResourceID;
336334

337-
if (Result == CFE_SUCCESS)
335+
if (ResultGetResourceID == CFE_SUCCESS)
338336
{
339337
/* We got a valid ResourceID, so get the Resource info */
340338

341339
ResultGetResourceInfo = CFE_ES_GetModuleInfo(&AppInfo, ResourceID);
342-
Result = ResultGetResourceInfo;
343340
}
344341

345-
if (Result == CFE_SUCCESS)
342+
if (ResultGetResourceInfo == CFE_SUCCESS)
346343
{
347344
/* We got a valid ResourceID and good App info, so check the for valid addresses */
348345

349346
if (AppInfo.AddressesAreValid == false)
350347
{
351348
CFE_EVS_SendEvent(CS_COMPUTE_APP_PLATFORM_DBG_EID, CFE_EVS_EventType_DEBUG,
352349
"CS cannot get a valid address for %s, due to the platform", ResultsEntry->Name);
353-
Result = CS_ERROR;
350+
ResultGetResourceInfo = CS_ERROR;
354351
}
355352
else
356353
{
357354
/* Push in the data from the module info */
358355
ResultsEntry->NumBytesToChecksum = AppInfo.CodeSize;
359356
ResultsEntry->StartAddress = AppInfo.CodeAddress;
360-
Result = CFE_SUCCESS;
361357
ResultAddressValid = true;
362358
}
363359
}
364360

365-
if (Result == CFE_SUCCESS)
361+
if (ResultGetResourceInfo == CFE_SUCCESS)
366362
{
367363
/* We got valid ResourceID, good info, and valid addresses, so run the checksum */
368364

0 commit comments

Comments
 (0)