Files
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 <aliceryhl@google.com>
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Abdiel Janulgue <abdiel.janulgue@gmail.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://lore.kernel.org/r/20250628165120.90149-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
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-19 12:55:40 +05:30
2025-05-20 10:04:06 +05:30
2025-03-16 21:59:19 +01:00
2025-02-22 15:44:19 +01:00
2025-05-27 20:09:59 +02:00
2024-12-20 17:21:04 +01:00
2024-10-08 15:44:36 +02:00
2025-04-29 15:31:07 +02:00
2024-11-04 16:21:44 -05:00