[PATCH v2 2/2] rust: types: rename Opaque::raw_get to cast_into

Benno Lossin lossin at kernel.org
Wed Jun 25 22:18:26 UTC 2025


On Tue Jun 24, 2025 at 5:27 PM CEST, Alice Ryhl wrote:
> In the previous patch we added Opaque::cast_from() that performs the
> opposite operation to Opaque::raw_get(). For consistency with this
> naming, rename raw_get() to cast_from().
>
> There are a few other options such as calling cast_from() something
> closer to raw_get() rather than renaming this method. However, I could
> not find a great naming scheme that works with raw_get(). The previous
> version of this patch used from_raw(), but functions of that name
> typically have a different signature, so that's not a great option.
>
> Suggested-by: Danilo Krummrich <dakr at kernel.org>
> Signed-off-by: Alice Ryhl <aliceryhl at google.com>
> ---
>  rust/kernel/configfs.rs                | 2 +-
>  rust/kernel/init.rs                    | 6 +++---
>  rust/kernel/lib.rs                     | 4 ++--
>  rust/kernel/list.rs                    | 2 +-
>  rust/kernel/list/impl_list_item_mod.rs | 4 ++--
>  rust/kernel/time/hrtimer.rs            | 4 ++--
>  rust/kernel/types.rs                   | 8 ++++----
>  rust/kernel/workqueue.rs               | 2 +-
>  8 files changed, 16 insertions(+), 16 deletions(-)

For init.rs:

Acked-by: Benno Lossin <lossin at kernel.org>

---
Cheers,
Benno


More information about the dri-devel mailing list