From: sashiko-bot@kernel.org
To: "Lyude Paul" <lyude@redhat.com>
Cc: ojeda@kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v19 3/4] rust: faux: Allow retrieving a bound Device
Date: Mon, 08 Jun 2026 18:41:47 +0000 [thread overview]
Message-ID: <20260608184147.A5B421F00899@smtp.kernel.org> (raw)
In-Reply-To: <20260608183057.2001376-4-lyude@redhat.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing invariant justification and typographical error in newly added type invariant.
--
commit c766343de61d0beee77e4a7b0e0b4da2f1f15d4d
Author: Lyude Paul <lyude@redhat.com>
rust: faux: Allow retrieving a bound Device
This commit modifies the Registration object to allow retrieving a bound
Device, implementing AsRef for the Bound device context. It also updates the
struct invariants to document that the registration serves as proof that
the device is bound.
> 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]
Does this documentation contain a typographical error? In the Linux device
model, a device binds to a driver.
Additionally, since a new type invariant is added here, does the constructor
need an updated invariant justification?
Looking at Registration::new(), the comment only justifies the first
invariant:
// INVARIANT: The device will remain registered until
// faux_device_destroy() is called, which happens in our Drop
// implementation.
Ok(Self(NonNull::new(dev).ok_or(ENODEV)?))
Should this comment be updated to explain why the new invariant holds, such
as explaining that the driver handles binding implicitly during
registration?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260608183057.2001376-1-lyude@redhat.com?part=3
next prev parent reply other threads:[~2026-06-08 18:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 18:29 [PATCH v19 0/4] Rust bindings for gem shmem Lyude Paul
2026-06-08 18:29 ` [PATCH v19 1/4] rust: drm: gem: shmem: Add DmaResvGuard helper Lyude Paul
2026-06-08 18:43 ` sashiko-bot
2026-06-09 18:19 ` lyude
2026-06-09 19:28 ` Miguel Ojeda
2026-06-08 18:29 ` [PATCH v19 2/4] rust: drm: gem: shmem: Add vmap functions Lyude Paul
2026-06-08 18:45 ` sashiko-bot
2026-06-08 18:29 ` [PATCH v19 3/4] rust: faux: Allow retrieving a bound Device Lyude Paul
2026-06-08 18:41 ` sashiko-bot [this message]
2026-06-08 18:29 ` [PATCH v19 4/4] rust: drm: gem: Introduce shmem::Object::sg_table() Lyude Paul
2026-06-08 18:48 ` sashiko-bot
2026-06-10 15:46 ` lyude
2026-06-08 18:50 ` [PATCH v19 0/4] Rust bindings for gem shmem Danilo Krummrich
2026-06-10 0:20 ` Deborah Brouwer
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=20260608184147.A5B421F00899@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.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