From: sashiko-bot@kernel.org
To: "Lyude Paul" <lyude@redhat.com>
Cc: linux-media@vger.kernel.org, ojeda@kernel.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v18 3/4] rust: faux: Allow retrieving a bound Device
Date: Thu, 04 Jun 2026 19:39:59 +0000 [thread overview]
Message-ID: <20260604194000.3F1061F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260604192740.659240-4-lyude@redhat.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The `Registration` struct's `# Invariants` documentation was updated with a new invariant, but the `// INVARIANT:` comment in the `Registration::new` constructor was not updated to explain why this new invariant is satisfied.
- [Low] Typo in the new type invariant comment: it incorrectly states the object is 'bound to a device' instead of 'bound to a driver'.
--
commit d541fc9c1199eb4e3a390c6348b6b03f9492aacc
Author: Lyude Paul <lyude@redhat.com>
rust: faux: Allow retrieving a bound Device
This commit updates faux::Registration to implement AsRef for a bound
device instead of a generic device. It also adds a new invariant to the
Registration struct to document that the object is proof of a driver being
bound to the device.
> diff --git a/rust/kernel/faux.rs b/rust/kernel/faux.rs
> index 43b4974f48cd2..20ab638885354 100644
> --- a/rust/kernel/faux.rs
> +++ b/rust/kernel/faux.rs
> @@ -25,7 +25,8 @@
> ///
> /// # Invariants
> ///
> -/// `self.0` always holds a valid pointer to an initialized and registered [`struct faux_device`].
> +/// - `self.0` always holds a valid pointer to an initialized and registered [`struct faux_device`].
> +/// - This object is proof that the object described by this `Registration` is bound to a device.
[Severity: Low]
This isn't a bug, but there appears to be a typo here. The commit message
states that the Registration object is proof that "a driver is bound to the
device". Should this invariant say it is bound to a "driver" instead of
a "device"?
[Severity: Low]
Since a new invariant was added to the documentation here, does the
// INVARIANT: comment in Registration::new() also need to be updated to
explain why this new invariant is satisfied?
Currently, the comment in Registration::new() only explains the first
invariant:
// INVARIANT: The device will remain registered until faux_device_destroy()
// is called, which happens in our Drop implementation.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260604192740.659240-1-lyude@redhat.com?part=3
next prev parent reply other threads:[~2026-06-04 19:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 19:24 [PATCH v18 0/4] Rust bindings for gem shmem Lyude Paul
2026-06-04 19:24 ` [PATCH v18 1/4] rust: drm: gem: shmem: Add DmaResvGuard helper Lyude Paul
2026-06-04 19:39 ` sashiko-bot
2026-06-04 20:03 ` Claude review: " Claude Code Review Bot
2026-06-04 19:24 ` [PATCH v18 2/4] rust: drm: gem: shmem: Add vmap functions Lyude Paul
2026-06-04 19:41 ` sashiko-bot
2026-06-04 20:03 ` Claude review: " Claude Code Review Bot
2026-06-04 19:24 ` [PATCH v18 3/4] rust: faux: Allow retrieving a bound Device Lyude Paul
2026-06-04 19:39 ` sashiko-bot [this message]
2026-06-04 20:03 ` Claude review: " Claude Code Review Bot
2026-06-04 19:24 ` [PATCH v18 4/4] rust: drm: gem: Introduce shmem::Object::sg_table() Lyude Paul
2026-06-04 19:54 ` sashiko-bot
2026-06-04 20:03 ` Claude review: " Claude Code Review Bot
2026-06-04 20:03 ` Claude review: Rust bindings for gem shmem 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=20260604194000.3F1061F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-media@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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