diff options
| author | Danilo Krummrich <[email protected]> | 2025-06-28 16:49:54 +0000 |
|---|---|---|
| committer | Danilo Krummrich <[email protected]> | 2025-07-01 12:14:40 +0000 |
| commit | 2dedf83d54c6248317ce86d9fc677f89e37ab04c (patch) | |
| tree | dfc48e216b5a4481c3edaa8d5fc3f55ecd303b26 /rust/helpers/pid_namespace.c | |
| parent | Merge tag 'topic/dma-features-2025-06-23' into alloc-next (diff) | |
| download | kernel-2dedf83d54c6248317ce86d9fc677f89e37ab04c.tar.gz kernel-2dedf83d54c6248317ce86d9fc677f89e37ab04c.zip | |
rust: dma: require mutable reference for as_slice_mut() and write()
Given the safety requirements of as_slice_mut() and write() taking an
immutable reference is technically not incorrect.
However, let's leverage the compiler's capabilities and require a
mutable reference to ensure exclusive access.
This also fixes a clippy warning introduced with 1.88:
warning: mutable borrow from immutable input(s)
--> rust/kernel/dma.rs:297:78
|
297 | pub unsafe fn as_slice_mut(&self, offset: usize, count: usize) -> Result<&mut [T]> {
| ^^^^^^^^
Fixes: d37a39f607c4 ("rust: dma: add as_slice/write functions for CoherentAllocation")
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Andreas Hindborg <[email protected]>
Reviewed-by: Abdiel Janulgue <[email protected]>
Reviewed-by: Alexandre Courbot <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Danilo Krummrich <[email protected]>
Diffstat (limited to 'rust/helpers/pid_namespace.c')
0 files changed, 0 insertions, 0 deletions
