Files
erofs-linux/rust/kernel
Danilo Krummrich 2dedf83d54 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: d37a39f607 ("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]>
2025-07-01 14:14:40 +02:00
..
2025-05-30 07:12:05 +02:00
2025-05-29 23:35:44 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2025-05-27 20:09:59 +02:00
…
…
…
…
…
…
…
…
…
…