From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: io: add `read_val` and `write_val` function on I/O view Date: Thu, 23 Apr 2026 08:25:46 +1000 Message-ID: In-Reply-To: <20260421-io_projection-v2-8-4c251c692ef4@garyguo.net> References: <20260421-io_projection-v2-0-4c251c692ef4@garyguo.net> <20260421-io_projection-v2-8-4c251c692ef4@garyguo.net> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review Adds `io_read!` and `io_write!` macros built on `View::read_val`/`write_val` which call through `IoCapable`. Also implements `IoCapable` for `Coherent` for primitive types (u8, u16, u32, and u64 on 64-bit). The `io_write!` macro uses the same `@parse` recursive pattern as the old `dma_write!` to separate the projection from the value argument. This is a known Rust macro technique for handling the ambiguity. The safety comments for the DMA `IoCapable` implementation appropriately document the LKMM exception: ```rust // - Using read_volatile() here is not sound if it races with other CPU per Rust // rules, but this is allowed per LKMM. ``` --- Generated by Claude Code Patch Reviewer