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

Dead code checking for CFE_ES_RunStatus_SYS_EXCEPTION and NULL bufptr #97

Open
2 tasks done
thnkslprpt opened this issue Oct 12, 2024 · 0 comments · May be fixed by #98
Open
2 tasks done

Dead code checking for CFE_ES_RunStatus_SYS_EXCEPTION and NULL bufptr #97

thnkslprpt opened this issue Oct 12, 2024 · 0 comments · May be fixed by #98

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
There are a couple of minor sections of dead/unnecessary code in CS.

Code snips

  1. bufptr cannot be NULL (this is guaranteed by CFE_SB_ReceiveBuffer if the return value is CFE_SUCCESS):

    CS/fsw/src/cs_app.c

    Lines 86 to 91 in f958cc0

    Result = CFE_SB_ReceiveBuffer(&BufPtr, CS_AppData.CmdPipe, CS_WAKEUP_TIMEOUT);
    /* Performance Log (start time counter) */
    CFE_ES_PerfLogEntry(CS_APPMAIN_PERF_ID);
    if ((Result == CFE_SUCCESS) && (BufPtr != NULL))

  2. Apparently code was removed that set the run status to CFE_ES_RunStatus_SYS_EXCEPTION, but this check was left in:

    if (CS_AppData.RunStatus == CFE_ES_RunStatus_APP_ERROR || CS_AppData.RunStatus == CFE_ES_RunStatus_SYS_EXCEPTION)

Expected behavior
Remove dead code to reduce unnecessary clutter.

Reporter Info
Avi Weiss   @thnkslprpt

thnkslprpt added a commit to thnkslprpt/CS that referenced this issue Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant