]> git.dujemihanovic.xyz Git - linux.git/commit
rust: types: add `Opaque::raw_get`
authorBenno Lossin <benno.lossin@proton.me>
Sat, 8 Apr 2023 12:25:39 +0000 (12:25 +0000)
committerMiguel Ojeda <ojeda@kernel.org>
Wed, 12 Apr 2023 16:41:05 +0000 (18:41 +0200)
commit3ff6e785ad99893f1d502156d23560efd30fec4d
tree43f1469f5ea3e1cc17096d757b272cd5313b72b1
parentd6dbca3592209d29c10e171224c34803805e88ca
rust: types: add `Opaque::raw_get`

This function mirrors `UnsafeCell::raw_get`. It avoids creating a
reference and allows solely using raw pointers.
The `pin-init` API will be using this, since uninitialized memory
requires raw pointers.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20230408122429.1103522-6-y86-dev@protonmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/types.rs