From: sashiko-bot@kernel.org
To: "Markus Probst" <markus.probst@posteo.de>
Cc: linux-serial@vger.kernel.org, ojeda@kernel.org, gary@garyguo.net
Subject: Re: [PATCH v4 4/4] rust: serdev: Simplify callbacks
Date: Fri, 16 Oct 2026 18:17:00 +0000 [thread overview]
Message-ID: <sashiko-outbox-174761@kernel.org> (raw)
In-Reply-To: <20261016-rust_serdev_probe_refactor-v4-4-46832e034757@posteo.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] rust: missing #[inline] on OpenGuard::drop
--
commit 3744d6179fccd8a1197885b1019f91d6e5f289b7
Author: Markus Probst <markus.probst@posteo.de>
rust: serdev: Simplify callbacks
This commit initializes the driver's private data directly on PrivateData
and introduces OpenGuard for resource cleanup.
> diff --git a/rust/kernel/serdev.rs b/rust/kernel/serdev.rs
> index c16d6593a8d2d..3f9165e167764 100644
> --- a/rust/kernel/serdev.rs
> +++ b/rust/kernel/serdev.rs
[ ... ]
> @@ -92,24 +88,36 @@ unsafe fn unregister(sdrv: &Opaque<Self::DriverType>) {
> }
> }
>
> +struct OpenGuard<'bound> {
> + sdev: &'bound Device<device::Bound>,
> +}
> +
> +impl Drop for OpenGuard<'_> {
> + fn drop(&mut self) {
[Severity: Low]
This isn't a bug, but should the drop method on OpenGuard be annotated with
#[inline]?
The Rust subsystem guidelines recommend using #[inline] on small functions in
abstractions that forward directly to a C binding call, such as the call to
bindings::serdev_device_close() here.
> + // SAFETY:
> + // - `self.sdev.as_raw()` is guaranteed to be a pointer to a valid
> + // `struct serdev_device`.
> + // - The existence of self proves that the device is open.
> + unsafe { bindings::serdev_device_close(self.sdev.as_raw()) };
> + }
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-rust_serdev_probe_refactor-v4-0-46832e034757@posteo.de?part=4
prev parent reply other threads:[~2026-10-16 18:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 18:00 [PATCH v4 0/4] rust: serdev: Refactor Markus Probst
2026-10-16 18:00 ` [PATCH v4 1/4] tty: serdev: Add mutex lock Markus Probst
2026-10-16 18:15 ` sashiko-bot
2026-10-16 18:00 ` [PATCH v4 2/4] tty: serdev: Export functions to pause receive_buf callback calls Markus Probst
2026-10-16 18:13 ` sashiko-bot
2026-10-16 18:00 ` [PATCH v4 3/4] rust: serdev: Replace `active` mutex with receive pause Markus Probst
2026-10-16 18:11 ` sashiko-bot
2026-10-16 18:00 ` [PATCH v4 4/4] rust: serdev: Simplify callbacks Markus Probst
2026-10-16 18:17 ` sashiko-bot [this message]
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=sashiko-outbox-174761@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-serial@vger.kernel.org \
--cc=markus.probst@posteo.de \
--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