]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: arc: use `NonNull::new_unchecked`
authorTamir Duberstein <tamird@gmail.com>
Wed, 20 Nov 2024 11:46:00 +0000 (06:46 -0500)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 13 Jan 2025 22:45:30 +0000 (23:45 +0100)
commitc6340da3d254ee491fc113d4dc5566bea7bebdf3
tree1f4db50bc0ec0d45d7d70369b038663cf9d352ed
parent47cb6bf7860ce33bdd000198f8b65cf9fb3324b4
rust: arc: use `NonNull::new_unchecked`

There is no need to check (and panic on violations of) the safety
requirements on `ForeignOwnable` functions. Avoiding the check is
consistent with the implementation of `ForeignOwnable` for `Box`.

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