Re: [PATCH v2 3/5] rust: pin-init: add `ptr_init` and `ptr_try_init` and recommend over `__init`

"Benno Lossin" <[email protected]> Wed, 05 Aug 2026 12:22:54 +0200
Newsgroups org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pwm
Message-ID <[email protected]>
On Wed Jul 29, 2026 at 5:38 PM CEST, Gary Guo wrote:
> The `__init` method is not designed to be a public API (existence of "__"
> is a hint for this); but currently there is no other API that allows raw
> initialization on pointers. Add `ptr_init` and `ptr_try_init` and recommend
> people to use this instead if raw pointer initialization is needed.

How about we call these two functions `raw_init` and `raw_try_init`
respectively? I feel like that conveys the meaning of what they are
doing much better.

With that: Reviewed-by: Benno Lossin <[email protected]>

Cheers,
Benno

> Signed-off-by: Gary Guo <[email protected]>
> ---
>  rust/pin-init/examples/static_init.rs |  5 +++--
>  rust/pin-init/src/lib.rs              | 32 +++++++++++++++++++++++++++++++-
>  2 files changed, 34 insertions(+), 3 deletions(-)