Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Incorrect use of `#[inline(always)]` on `__call_ioctl` without `build_assert!()`. --
commit 681c752cb3d2e7c1fa7dd279a52a3695aceaee3b Author: Danilo Krummrich <[email protected]> rust: drm: restrict AlwaysRefCounted to Normal Device context This commit restricts the AlwaysRefCounted implementation for drm::Device to the Normal context. It clarifies that registered devices represent non-owning views and must not be independently reference-counted. The commit also refactors DRM IOCTL handling to use a lifetime-bounded closure approach. [ ... ] > diff --git a/rust/kernel/drm/ioctl.rs b/rust/kernel/drm/ioctl.rs > index cf328101dde4e..023e6da5c1e4b 100644 > --- a/rust/kernel/drm/ioctl.rs > +++ b/rust/kernel/drm/ioctl.rs > @@ -70,6 +70,39 @@ pub mod internal { > pub use bindings::drm_device; > pub use bindings::drm_file; > pub use bindings::drm_ioctl_desc; > + > + /// Call an ioctl handler with lifetime-bounded references. > + /// > + /// The lifetime `'a` is tied to the `_anchor` parameter. This prevents > handlers from > + /// declaring `'static` on `dev`, `data`, or `file`. > + /// > + /// # Safety > + /// > + /// - `raw_data` must point to a valid, exclusively-owned instance of > `Data` for the duration > + /// of the call. > + /// - `raw_file` must be a valid pointer to a `struct drm_file`. > + #[doc(hidden)] > + #[inline(always)] > + pub unsafe fn __call_ioctl< [Severity: Low] This isn't a bug, but is the #[inline(always)] attribute intended here? According to the Rust subsystem guidelines, #[inline(always)] should only be used for functions using build_assert!() that depend on function parameters. For forwarding abstractions like __call_ioctl(), the standard #[inline] attribute is preferred since it lacks parameter-dependent build-time assertions. > + 'a, > + Dev: 'a, > + Data: 'a, > + F: super::super::file::DriverFile + 'a, > + Ret, > + >( -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=5
