From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: rust: rename `AlwaysRefCounted` to `RefCounted`.
Date: Fri, 27 Feb 2026 15:11:57 +1000 [thread overview]
Message-ID: <review-patch3-20260224-unique-ref-v16-3-c21afcb118d3@kernel.org> (raw)
In-Reply-To: <20260224-unique-ref-v16-3-c21afcb118d3@kernel.org>
Patch Review
This is a large mechanical rename across 20 files. The split into `RefCounted` (methods) and `AlwaysRefCounted` (marker for `&T -> ARef<T>`) is well-motivated.
**Minor concern with SAFETY comments**: Several `AlwaysRefCounted` marker impls use the justification:
```rust
// SAFETY: We do not implement `Ownable`, thus it is okay to obtain an `ARef<Device>` from a
// `&Device`.
```
While correct now, this places the safety burden on a *negative* (not implementing another trait), which could be fragile if someone later adds `Ownable` without remembering to remove `AlwaysRefCounted`. The safety comment in the trait definition does document this correctly, but it's worth noting this is an inherent challenge with marker traits.
**Copy-paste issue in DRM gem**: The safety comment says `ARef<Device>` when it should say `ARef<Object>`:
```rust
// SAFETY: We do not implement `Ownable`, thus it is okay to obtain an `ARef<Device>` from a
// `&Object`.
```
The text mentions both `Device` and `Object` inconsistently. Should be `ARef<Object<T>>` throughout.
Similarly in `i2c.rs`, the I2cAdapter and I2cClient marker impls both say `ARef<Device>` instead of `ARef<I2cAdapter>` / `ARef<I2cClient>`:
```rust
// SAFETY: We do not implement `Ownable`, thus it is okay to obtain an `ARef<Device>` from an
// `&I2cAdapter`.
```
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-27 5:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 11:17 [PATCH v16 00/10] rust: add `Ownable` trait and `Owned` type Andreas Hindborg
2026-02-24 11:17 ` [PATCH v16 01/10] rust: alloc: add `KBox::into_nonnull` Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:17 ` [PATCH v16 02/10] rust: types: Add Ownable/Owned types Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:17 ` [PATCH v16 03/10] rust: rename `AlwaysRefCounted` to `RefCounted` Andreas Hindborg
2026-02-27 5:11 ` Claude Code Review Bot [this message]
2026-02-24 11:17 ` [PATCH v16 04/10] rust: Add missing SAFETY documentation for `ARef` example Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:18 ` [PATCH v16 05/10] rust: aref: update formatting of use statements Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:18 ` [PATCH v16 06/10] rust: Add `OwnableRefCounted` Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:18 ` [PATCH v16 07/10] rust: page: update formatting of `use` statements Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:18 ` [PATCH v16 08/10] rust: page: convert to `Ownable` Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:18 ` [PATCH v16 09/10] rust: implement `ForeignOwnable` for `Owned` Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-24 11:18 ` [PATCH v16 10/10] rust: page: add `from_raw()` Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review Bot
2026-02-27 5:11 ` Claude review: rust: add `Ownable` trait and `Owned` type Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-02-20 9:51 [PATCH v15 0/9] " Andreas Hindborg
2026-02-20 9:51 ` [PATCH v15 2/9] rust: rename `AlwaysRefCounted` to `RefCounted` Andreas Hindborg
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch3-20260224-unique-ref-v16-3-c21afcb118d3@kernel.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox