summaryrefslogtreecommitdiff
path: root/rust/kernel/types.rs
diff options
context:
space:
mode:
authorGary Guo <gary@garyguo.net>2026-07-29 16:38:46 +0100
committerGary Guo <gary@garyguo.net>2026-08-05 11:36:18 +0100
commitea7da3116015de801840f3e011dee907fb118f0c (patch)
tree0b091d682c38d30ba30c10f77029a507d19b8cc2 /rust/kernel/types.rs
parentd5492db2bf30b7e617e41d4fe3dba22475a1a354 (diff)
downloadlinux-ea7da3116015de801840f3e011dee907fb118f0c.tar.gz
linux-ea7da3116015de801840f3e011dee907fb118f0c.zip
rust: treewide: replace `__pinned_init` with `raw_[try_]init`
The `__init` method is not designed to be a public API (existence of "__" is a hint for this); replace users with `pin_init::raw_[try_]init` which does the same thing. There are a few users of `__init` which are replaced as well. Acked-by: Miguel Ojeda <ojeda@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260729-merge-init-v2-4-26adf47109e7@garyguo.net Signed-off-by: Gary Guo <gary@garyguo.net>
Diffstat (limited to 'rust/kernel/types.rs')
-rw-r--r--rust/kernel/types.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/kernel/types.rs b/rust/kernel/types.rs
index ac316fd7b538..67b3874cb3d2 100644
--- a/rust/kernel/types.rs
+++ b/rust/kernel/types.rs
@@ -417,13 +417,13 @@ impl<T> Opaque<T> {
impl<T> Wrapper<T> for Opaque<T> {
/// Create an opaque pin-initializer from the given pin-initializer.
- fn pin_init<E>(slot: impl PinInit<T, E>) -> impl PinInit<Self, E> {
- Self::try_ffi_init(|ptr: *mut T| {
+ fn pin_init<E>(init: impl PinInit<T, E>) -> impl PinInit<Self, E> {
+ Self::try_ffi_init(|slot: *mut T| {
// SAFETY:
- // - `ptr` is a valid pointer to uninitialized memory,
+ // - `slot` is a valid pointer to uninitialized memory,
// - `slot` is not accessed on error,
// - `slot` is pinned in memory.
- unsafe { PinInit::<T, E>::__pinned_init(slot, ptr) }
+ unsafe { pin_init::raw_try_init(slot, init) }
})
}
}