From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: rust: drm: gem: Introduce shmem::Object::sg_table()
Date: Thu, 04 Jun 2026 16:06:44 +1000 [thread overview]
Message-ID: <review-patch6-20260529183702.677677-7-lyude@redhat.com> (raw)
In-Reply-To: <20260529183702.677677-7-lyude@redhat.com>
Patch Review
**Status: Looks good**
This patch adds the test for the wrong-device rejection path that was introduced in patch 3. The test is well-structured:
```rust
fn fail_sg_table_on_wrong_dev() -> Result {
let (_dev, drm) = create_drm_dev()?;
let wrong_dev = faux::Registration::new(c"EvilKunit", None)?;
let obj = Object::<KunitObject>::new(&drm, PAGE_SIZE, ObjectConfig::default(), ())?;
assert_eq!(obj.sg_table(wrong_dev.as_ref()).err().unwrap(), EINVAL);
// If sgt_res was not initialized mistakenly with the wrong device, this should still fail.
assert_eq!(obj.sg_table(wrong_dev.as_ref()).err().unwrap(), EINVAL);
```
The double-call test is a good edge case check — it verifies that `sgt_res` (the `LazyInit`) isn't accidentally initialized with the wrong device on the first call.
The TODO comments about needing dummy dma_ops for success-path testing are reasonable.
---
**Summary**: The series is well-designed and mostly correct. The two actionable items are: (1) fix the kdoc function name in patch 5 to say `__drm_gem_shmem_free_sgt_locked`, and (2) consider adding a NULL guard or `drm_WARN_ON` for `shmem->sgt` in `__drm_gem_shmem_free_sgt_locked()` since it's an exported symbol. The kdoc claim about "unpin" is also inaccurate and should say "DMA unmap and release" instead.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-06-04 6:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 18:33 [PATCH v15 0/6] Rust bindings for gem shmem Lyude Paul
2026-05-29 18:33 ` [PATCH v15 1/6] rust: gem: shmem: Fix Default implementation for ObjectConfig Lyude Paul
2026-06-04 6:06 ` Claude review: " Claude Code Review Bot
2026-05-29 18:34 ` [PATCH v15 2/6] rust: drm: gem/shmem: Add DmaResvGuard helper Lyude Paul
2026-06-04 6:06 ` Claude review: " Claude Code Review Bot
2026-05-29 18:34 ` [PATCH v15 3/6] rust: drm: gem: Add vmap functions to shmem bindings Lyude Paul
2026-06-04 6:06 ` Claude review: " Claude Code Review Bot
2026-05-29 18:34 ` [PATCH v15 4/6] rust: faux: Allow retrieving a bound Device Lyude Paul
2026-06-04 6:06 ` Claude review: " Claude Code Review Bot
2026-05-29 18:34 ` [PATCH v15 5/6] drm/gem/shmem: Introduce __drm_gem_shmem_free_sgt_locked() Lyude Paul
2026-06-04 6:06 ` Claude review: " Claude Code Review Bot
2026-05-29 18:34 ` [PATCH v15 6/6] rust: drm: gem: Introduce shmem::Object::sg_table() Lyude Paul
2026-06-04 6:06 ` Claude Code Review Bot [this message]
2026-06-04 6:06 ` Claude review: Rust bindings for gem shmem Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-06-04 19:24 [PATCH v18 0/4] " Lyude Paul
2026-06-04 19:24 ` [PATCH v18 4/4] rust: drm: gem: Introduce shmem::Object::sg_table() Lyude Paul
2026-06-04 20:03 ` Claude review: " Claude Code Review Bot
2026-06-03 19:42 [PATCH v17 0/6] Rust bindings for gem shmem Lyude Paul
2026-06-03 19:42 ` [PATCH v17 6/6] rust: drm: gem: Introduce shmem::Object::sg_table() Lyude Paul
2026-06-04 1:29 ` Claude review: " Claude Code Review Bot
2026-06-02 17:24 [PATCH v16 0/6] Rust bindings for gem shmem Lyude Paul
2026-06-02 17:25 ` [PATCH v16 6/6] rust: drm: gem: Introduce shmem::Object::sg_table() Lyude Paul
2026-06-04 2:29 ` Claude review: " Claude Code Review Bot
2026-05-26 21:28 [PATCH v14 0/6] rust: drm: gem: shmem: Add sg_table() function Lyude Paul
2026-05-26 21:28 ` [PATCH v14 6/6] rust: drm: gem: Introduce shmem::Object::sg_table() Lyude Paul
2026-05-27 4:05 ` 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-patch6-20260529183702.677677-7-lyude@redhat.com \
--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