Skip to content

Use const interface pointers in protocol management functions #981

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

Merged

Conversation

nicholasbishop
Copy link
Member

A protocol's interface may mutate itself, but the void pointer passed to the {install,reinstall,uninstall}_protocol_interface functions is opaque to the firmware, so there's no need for it to be a mut pointer.

Note that from a Rust safety perspective there's no difference here -- mut and const pointers are interchangeable.

#970

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

A protocol's interface may mutate itself, but the void pointer passed to the
`{install,reinstall,uninstall}_protocol_interface` functions is opaque to the
firmware, so there's no need for it to be a mut pointer.

Note that from a Rust safety perspective there's no difference here -- mut and
const pointers are interchangeable.

rust-osdev#970
@phip1611 phip1611 added this pull request to the merge queue Oct 29, 2023
Merged via the queue into rust-osdev:main with commit d406e1f Oct 29, 2023
@nicholasbishop nicholasbishop deleted the bishop-install-interface-const branch October 29, 2023 18:43
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