Skip to content

Use const interface pointers in protocol management functions - #981

Merged
phip1611 merged 1 commit into
rust-osdev:mainfrom
nicholasbishop:bishop-install-interface-const
Oct 29, 2023
Merged

Use const interface pointers in protocol management functions#981
phip1611 merged 1 commit into
rust-osdev:mainfrom
nicholasbishop:bishop-install-interface-const

Conversation

@nicholasbishop

Copy link
Copy Markdown
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