Re: [PATCH v5 18/20] rust: dma: drop `dma_read!` and `dma_write!` API

"Alexandre Courbot" <[email protected]>
Newsgroups org.kernel.vger.linux-pwm,dev.linux.lists.driver-core,dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
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 <[email protected]>
> Signed-off-by: Gary Guo <[email protected]>

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 <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.