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

Minor redundancy cleanup from static analysis warnings #819

Closed
skliper opened this issue Feb 17, 2021 · 0 comments · Fixed by #820 or #830
Closed

Minor redundancy cleanup from static analysis warnings #819

skliper opened this issue Feb 17, 2021 · 0 comments · Fixed by #820 or #830
Assignees
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Feb 17, 2021

Is your feature request related to a problem? Please describe.
Two minor redundant logic/checks:

for (signo = SIGRTMIN; signo <= SIGRTMAX; ++signo)
{
if (!sigismember(&inuse, signo))
{
/* signal is available, stop search */
break;
}
}
if (signo < SIGRTMIN || signo > SIGRTMAX)
{
/* no available signal for timer */
OS_DEBUG("No free RT signals to use for simulated time base\n");
return_code = OS_TIMER_ERR_UNAVAILABLE;
}

status = OS_SUCCESS;

No actual issues, just minor cleanup.

Describe the solution you'd like
Remove first, refactor second so the bound is just checked in one place

Describe alternatives you've considered
None

Additional context
Static analysis warnings

Requester Info
Jacob Hageman - NASA

@skliper skliper added this to the 6.0.0 milestone Feb 17, 2021
@skliper skliper self-assigned this Feb 17, 2021
skliper added a commit to skliper/osal that referenced this issue Feb 17, 2021
astrogeco added a commit that referenced this issue Feb 24, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
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.

1 participant