Re: [PATCH v5 18/20] rust: dma: drop `dma_read!` and `dma_write!` API
From: Alexandre Courbot
Date: Fri Jul 03 2026 - 10:53:56 EST
On Fri Jun 26, 2026 at 11:45 PM JST, Gary Guo wrote:
> The primitive read/write use case is covered by the `io_read!` and
> `io_write!` macro. The non-primitive use case was finicky; they should
> either be achieved using `CoherentBox` or `as_ref()/as_mut()` to assert the
> lack of concurrent access, or should be using memcpy-like APIs to express
> the non-atomic and tearable nature.
>
> Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
> Signed-off-by: Gary Guo <gary@xxxxxxxxxxx>
The code looks good but the build breaks on this commit:
error[E0425]: cannot find type `CoherentBox` in this scope
--> ../samples/rust/rust_dma.rs:77:25
|
77 | let mut ca: CoherentBox<[MyStruct]> =
| ^^^^^^^^^^^
With that fixed,
Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>