All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Albert Esteve" <aesteve@redhat.com>
Cc: dri-devel@lists.freedesktop.org, ojeda@kernel.org,
	conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 2/5] rust: drm: add connector abstraction
Date: Mon, 17 Aug 2026 11:46:59 +0000	[thread overview]
Message-ID: <20260817114700.014081F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817-drm_panel_bindings-v1-2-1f974508a31c@redhat.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The `Connector` struct's `# Invariants` documentation incorrectly references an 'inner pointer', whereas the struct is a transparent wrapper around an `Opaque` type.
- [Low] The forwarding methods `from_raw` and `as_raw` in the `Connector` abstraction lack the required `#[inline]` attribute.
--

--- Patch [2]: [PATCH 2/5] rust: drm: add connector abstraction ---
commit 3b78dba370077b309a3e8fb4bdf3afb4e77c1754
Author: Albert Esteve <aesteve@redhat.com>

rust: drm: add connector abstraction

Add DRM Connector abstraction wrapping struct drm_connector.
Used by the DRM panel abstractions added in the following patch.

> diff --git a/rust/kernel/drm/connector.rs b/rust/kernel/drm/connector.rs
> new file mode 100644
> index 0000000000000..b3b36644375dd
> --- /dev/null
> +++ b/rust/kernel/drm/connector.rs
> @@ -0,0 +1,33 @@
[ ... ]
> +/// A DRM connector (`struct drm_connector`).
> +///
> +/// # Invariants
> +///
> +/// The inner pointer is always a valid, non-null pointer to a `struct drm_connector`.
> +#[repr(transparent)]
> +pub struct Connector(Opaque<bindings::drm_connector>);

[Severity: Low]
this isn't a bug, but the invariant documentation references an "inner pointer".
Since the struct directly wraps an Opaque type rather than holding a pointer
itself, should this be updated to reflect that?

> +
> +impl Connector {
> +    /// Creates a reference to a [`Connector`] from a raw pointer.
> +    ///
> +    /// # Safety
> +    ///
> +    /// `ptr` must be a valid, non-null pointer to a `struct drm_connector` that
> +    /// remains valid for at least the lifetime `'a`.
> +    pub unsafe fn from_raw<'a>(ptr: *mut bindings::drm_connector) -> &'a Self {

[Severity: Low]
this isn't a bug, but as a small forwarding function for an abstraction, should
this method be annotated with #[inline]?

> +        // SAFETY: Caller guarantees `ptr` is valid and lives for `'a`.
> +        unsafe { &*ptr.cast() }
> +    }
> +
> +    /// Returns the raw pointer to the underlying `struct drm_connector`.
> +    pub fn as_raw(&self) -> *mut bindings::drm_connector {

[Severity: Low]
this isn't a bug, but should this method also be annotated with #[inline]
since it merely forwards to the underlying binding call?

> +        self.0.get()
> +    }
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260817-drm_panel_bindings-v1-0-1f974508a31c@redhat.com?part=2

  reply	other threads:[~2026-08-17 11:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 11:40 [PATCH 0/5] rust: drm: add panel bindings Albert Esteve
2026-08-17 11:40 ` [PATCH 1/5] rust: of: add Node type Albert Esteve
2026-08-17 11:49   ` sashiko-bot
2026-08-17 15:18   ` Rob Herring
2026-08-17 11:40 ` [PATCH 2/5] rust: drm: add connector abstraction Albert Esteve
2026-08-17 11:46   ` sashiko-bot [this message]
2026-08-17 11:40 ` [PATCH 3/5] rust: drm: add panel consumer abstractions Albert Esteve
2026-08-17 11:51   ` sashiko-bot
2026-08-17 11:40 ` [PATCH 4/5] rust: drm: add panel producer abstractions Albert Esteve
2026-08-17 11:53   ` sashiko-bot
2026-08-17 11:40 ` [PATCH 5/5] rust: drm: add KUnit tests for panel Albert Esteve
2026-08-17 11:52   ` sashiko-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=20260817114700.014081F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=aesteve@redhat.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=robh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.