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

RISC-V Semihosting 1 of 3: Remove dead code #1198

Open
wants to merge 1 commit into
base: riscv
Choose a base branch
from

Conversation

JanMatCodasip
Copy link
Collaborator

@JanMatCodasip JanMatCodasip commented Jan 7, 2025

Variable target->semihosting is always initialized in riscv_init_target() to a non-NULL value.

For that reason, checks like if (target->semihosting) are redundant (dead code).

Remove them to not confuse code readers. Replace them by assertions.

Change-Id: I85ef52300e240cfcb0119db6169993bc4767de8f

Variable `target->semihosting` is always initialized
in risv_init_target() to a non-NULL value.

For that reason, checks like `if (target->semihosting)`
are redundant (dead code).

Remove them to not confuse code readers. Replace them by assertions.

Change-Id: I85ef52300e240cfcb0119db6169993bc4767de8f
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Copy link
Collaborator

@MarekVCodasip MarekVCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JanMatCodasip JanMatCodasip requested a review from en-sc January 8, 2025 06:50
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 this pull request may close these issues.

2 participants