Skip to content

Conversation

@kitcatier
Copy link

Description

Please describe the PR here.

Pre-Submission Checklist

When you submit a PR, please make sure your PR satisfies the following checklist:

  • I assert this contribution was authored by me.
  • I license this contribution under the license of this project.
  • The PR title describes your changes briefly and uses the present tense, without a trailing full stop.
  • The PR description describes the reason why we need the change.
  • This is an isolated change. No multiple changes and no unrelated changes are included.
  • Fixed all cargo clippy warnings.
  • Applied rustfmt.
    pub fn semihosting_halt(status: SemihostingExitStatus) {
    unsafe {
    outw(0x501, status as u16);
    }
    }

    hello, if a function's entire body is unsafe, the function is itself unsafe and should be marked appropriately. Marking them unsafe also means that callers must make sure they know what they're doing.

Copy link
Owner

@nuta nuta left a comment

Choose a reason for hiding this comment

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

Thanks! Left a suggestion.

Comment on lines +10 to 13
pub unsafe fn semihosting_halt(status: SemihostingExitStatus) {
unsafe {
outw(0x501, status as u16);
}
Copy link
Owner

Choose a reason for hiding this comment

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

nit:

Suggested change
pub unsafe fn semihosting_halt(status: SemihostingExitStatus) {
unsafe {
outw(0x501, status as u16);
}
pub unsafe fn semihosting_halt(status: SemihostingExitStatus) {
outw(0x501, status as u16);

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