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: introduce dma::CoherentInit for memory initialization Date: Wed, 04 Mar 2026 07:03:02 +1000 Message-ID: In-Reply-To: <20260303162314.94363-5-dakr@kernel.org> References: <20260303162314.94363-1-dakr@kernel.org> <20260303162314.94363-5-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review The design is sound: `CoherentInit` wraps a `Coherent` without ever exposing `dma_handle()`, guaranteeing no concurrent device access exists, which makes `Deref`/`DerefMut` safe. **Grammar issue in doc comment**: ```rust /// can't fulfill the requirements for creating a slice. For instance, it is not valid to have a /// (mutable) slice to of the memory of a [`Coherent`] ``` "slice to of the memory" should be "slice of the memory". **`init_at` bounds check**: The bounds check `if i >= self.0.len()` returns `EINVAL`, then the subsequent `&mut self[i]` goes through `DerefMut` which will index into the slice. Since the bounds check passed, this won't panic, but it does double-check bounds (once explicitly, once via slice indexing). Consider using `get_mut(i).ok_or(EINVAL)?` to avoid the redundancy, though this is minor. --- Generated by Claude Code Patch Reviewer