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 into an if/else #77

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

Combine consecutive mutually exclusive status checks into an if/else #77

thnkslprpt opened this issue Mar 5, 2023 · 0 comments · Fixed by #78

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
HS_EnableEventMonCmd() and HS_DisableEventMonCmd() have consecutive, mutually exclusive status checks.

Code snips

HS/fsw/src/hs_cmds.c

Lines 409 to 416 in 76915e9

if (Status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(HS_EVENTMON_LONG_SUB_EID, CFE_EVS_EventType_ERROR,
"Event Monitor Enable: Error Subscribing to long-format Events,RC=0x%08X",
(unsigned int)Status);
}
if (Status == CFE_SUCCESS)

HS/fsw/src/hs_cmds.c

Lines 465 to 472 in 76915e9

if (Status != CFE_SUCCESS)
{
CFE_EVS_SendEvent(HS_EVENTMON_LONG_UNSUB_EID, CFE_EVS_EventType_ERROR,
"Event Monitor Disable: Error Unsubscribing from long-format Events,RC=0x%08X",
(unsigned int)Status);
}
if (Status == CFE_SUCCESS)

Expected behavior
Combine into an if/else - no need to do 2 evaluations.

Reporter Info
Avi Weiss @thnkslprpt

dzbaker added a commit that referenced this issue Mar 30, 2023
…ually-exclusive-status-checks

Fix #77, 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.

3 participants