Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine consecutive, mutually-exclusive status checks #67

Closed
2 tasks done
thnkslprpt opened this issue Mar 13, 2023 · 0 comments · Fixed by #68
Closed
2 tasks done

Combine consecutive, mutually-exclusive status checks #67

thnkslprpt opened this issue Mar 13, 2023 · 0 comments · Fixed by #68
Milestone

Comments

@thnkslprpt
Copy link
Contributor

Checklist

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
A few cases of consecutive, mutually exclusive status checks in CS.

Code snips

CS/fsw/src/cs_init.c

Lines 64 to 71 in ed72e15

if (Result != CFE_SUCCESS)
{
CFE_EVS_SendEvent(CS_INIT_SB_SUBSCRIBE_HK_ERR_EID, CFE_EVS_EventType_ERROR,
"Software Bus subscribe to housekeeping returned: 0x%08X", (unsigned int)Result);
}
if (Result == CFE_SUCCESS)
{

CS/fsw/src/cs_init.c

Lines 112 to 120 in ed72e15

if (ResultInit != CFE_SUCCESS)
{
CS_AppData.HkPacket.EepromCSState = CS_STATE_DISABLED;
CFE_EVS_SendEvent(CS_INIT_EEPROM_ERR_EID, CFE_EVS_EventType_ERROR,
"Table initialization failed for Eeprom: 0x%08X", (unsigned int)ResultInit);
}
if (ResultInit == CFE_SUCCESS)
{

Expected behavior
Combine into if/else constructs - clearer and reduces evaluations.

Reporter Info
Avi Weiss @thnkslprpt

dzbaker added a commit that referenced this issue Apr 13, 2023
…ive-status-checks

Fix #67, Combine consecutive, mutually-exclusive status checks
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants