]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: types: avoid `as` casts
authorTamir Duberstein <tamird@gmail.com>
Wed, 20 Nov 2024 11:46:01 +0000 (06:46 -0500)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 13 Jan 2025 22:45:30 +0000 (23:45 +0100)
commitaa991a2a819535a0014e1159b455b64e3db87510
treeadeb52ecfd462a58e5e46066197884217840f856
parentc6340da3d254ee491fc113d4dc5566bea7bebdf3
rust: types: avoid `as` casts

Replace `as` casts with `cast{,_mut}` calls which are a bit safer.

In one instance, remove an unnecessary `as` cast without replacement.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20241120-borrow-mut-v6-2-80dbadd00951@gmail.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/kernel/alloc/kbox.rs
rust/kernel/sync/arc.rs
rust/kernel/types.rs