Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH] rust: list: undo unintended replacement of method name
@ 2025-07-19 18:36 Miguel Ojeda
  2025-07-19 20:36 ` [PATCH] rust: list: Add an example for `ListLinksSelfPtr` usage Boqun Feng
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Miguel Ojeda @ 2025-07-19 18:36 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	rust-for-linux, linux-kernel, patches

When we renamed `Opaque::raw_get` to `cast_into`, there was one
replacement that was not supposed to be there.

It does not cause an issue so far because it is inside a macro rule (the
`ListLinksSelfPtr` one) that is unused so far. However, it will start
to be used soon.

Thus fix it now.

Fixes: 64fb810bce03 ("rust: types: rename Opaque::raw_get to cast_into")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 rust/kernel/list/impl_list_item_mod.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/list/impl_list_item_mod.rs b/rust/kernel/list/impl_list_item_mod.rs
index c1edba0a9501..3f6c30e14904 100644
--- a/rust/kernel/list/impl_list_item_mod.rs
+++ b/rust/kernel/list/impl_list_item_mod.rs
@@ -252,7 +252,7 @@ unsafe fn view_value(links_field: *mut $crate::list::ListLinks<$num>) -> *const
                 // the pointer stays in bounds of the allocation.
                 let self_ptr = unsafe { (links_field as *const u8).add(spoff) }
                     as *const ::core::cell::UnsafeCell<*const Self>;
-                let cell_inner = ::core::cell::UnsafeCell::cast_into(self_ptr);
+                let cell_inner = ::core::cell::UnsafeCell::raw_get(self_ptr);
                 // SAFETY: This is not a data race, because the only function that writes to this
                 // value is `prepare_to_insert`, but by the safety requirements the
                 // `prepare_to_insert` method may not be called in parallel with `view_value` or

base-commit: 23b128bba76776541dc09efaf3acf6242917e1f0
--
2.50.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-20  1:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-19 18:36 [PATCH] rust: list: undo unintended replacement of method name Miguel Ojeda
2025-07-19 20:36 ` [PATCH] rust: list: Add an example for `ListLinksSelfPtr` usage Boqun Feng
2025-07-19 20:54   ` Miguel Ojeda
2025-07-20  1:26     ` Boqun Feng
2025-07-19 21:05 ` [PATCH] rust: list: undo unintended replacement of method name Tamir Duberstein
2025-07-19 22:16 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox