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: page: add `from_raw()` Date: Fri, 27 Feb 2026 15:11:58 +1000 Message-ID: In-Reply-To: <20260224-unique-ref-v16-10-c21afcb118d3@kernel.org> References: <20260224-unique-ref-v16-0-c21afcb118d3@kernel.org> <20260224-unique-ref-v16-10-c21afcb118d3@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 Simple utility to create `&Page` from a raw `*const bindings::page`: ```rust pub unsafe fn from_raw<'a>(ptr: *const bindings::page) -> &'a Self { unsafe { &*ptr.cast() } } ``` This works because `Page` is `#[repr(transparent)]` over `Opaque`. The safety requirement ("ptr must be convertible to a shared reference with a lifetime of `'a`") is clear and appropriate. **Summary of actionable items:** 1. Fix typo "funvtion" -> "function" in patch 2 (`Owned::from_raw` safety comment) 2. Fix doc link `[`ARef`](crate::types::Owned)` -> correct target in patch 6 3. Fix inconsistent type names in `AlwaysRefCounted` SAFETY comments in patch 3 (drm/gem says `ARef` but should be `ARef`, i2c says `ARef` but should be `ARef`/`ARef`) --- Generated by Claude Code Patch Reviewer