summaryrefslogtreecommitdiff
path: root/rust/kernel/miscdevice.rs
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2024-11-20 14:46:03 +0300
committerMiguel Ojeda <ojeda@kernel.org>2025-01-14 01:45:31 +0300
commit14686571a914833e38eef0f907202f58df4ffcd2 (patch)
treecc169fb79d689f8f96f2ad705641ef7c6ca4fdce /rust/kernel/miscdevice.rs
parent5d385a356f628bd4a1d9f403588272d9626e3245 (diff)
downloadlinux-14686571a914833e38eef0f907202f58df4ffcd2.tar.xz
rust: kernel: change `ForeignOwnable` pointer to mut
It is slightly more convenient to operate on mut pointers, and this also properly conveys the desired ownership semantics of the trait. 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-4-80dbadd00951@gmail.com [ Reworded title slightly. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/miscdevice.rs')
-rw-r--r--rust/kernel/miscdevice.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs
index 9e1b9c0fae9d..b3a6cc50b240 100644
--- a/rust/kernel/miscdevice.rs
+++ b/rust/kernel/miscdevice.rs
@@ -189,7 +189,7 @@ unsafe extern "C" fn fops_open<T: MiscDevice>(
};
// SAFETY: The open call of a file owns the private data.
- unsafe { (*file).private_data = ptr.into_foreign().cast_mut() };
+ unsafe { (*file).private_data = ptr.into_foreign() };
0
}