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: dma: update to keyworded index projection syntax Date: Thu, 04 Jun 2026 12:43:27 +1000 Message-ID: In-Reply-To: <20260602-projection-syntax-rework-v2-4-6989470f5440@garyguo.net> References: <20260602-projection-syntax-rework-v2-0-6989470f5440@garyguo.net> <20260602-projection-syntax-rework-v2-4-6989470f5440@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 Converts the DMA subsystem's documentation examples and the `rust_dma` sample driver to use the new syntax. The doc examples are updated appropriately: ```rust -/// let whole = kernel::dma_read!(alloc, [2]?); -/// let field = kernel::dma_read!(alloc, [1]?.field); +/// let whole = kernel::dma_read!(alloc, [try: 2]); +/// let field = kernel::dma_read!(alloc, [panic: 1].field); ``` Nice that this also demonstrates the `panic` flavor in the docs, showing a case where the programmer knows the index is valid. The sample driver conversion is also good -- the `check_dma` function signature change from `fn check_dma(&self) -> Result` to `fn check_dma(&self)` is a logical consequence of switching from `[try: i]` (which uses `?` and thus requires `Result` return) to `[panic: i]` (which panics directly and doesn't need error propagation). The call site is simplified accordingly: ```rust - assert!(self.check_dma().is_ok()); + self.check_dma(); ``` This is a good change -- the old `assert!(is_ok())` was effectively panicking on error anyway, so the `panic` variant is semantically equivalent but cleaner. Already has Reviewed-by from Alice, Andreas, and Alexandre. No issues. --- Generated by Claude Code Patch Reviewer