From: Alice Ryhl <aliceryhl@google.com>
To: Deborah Brouwer <deborah.brouwer@collabora.com>
Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
daniel.almeida@collabora.com, boris.brezillon@collabora.com,
broonie@kernel.org, dakr@kernel.org,
miguel.ojeda.sandonis@gmail.com
Subject: Re: [PATCH] drm/tyr: suppress unread field warnings
Date: Fri, 23 Jan 2026 12:08:44 +0000 [thread overview]
Message-ID: <aXNkzF2bgaj21OsI@google.com> (raw)
In-Reply-To: <aXJ1F4e7wdgM83Oo@um790>
On Thu, Jan 22, 2026 at 11:05:59AM -0800, Deborah Brouwer wrote:
> On Thu, Jan 22, 2026 at 08:42:02AM +0000, Alice Ryhl wrote:
> > On Wed, Jan 21, 2026 at 04:37:46PM -0800, Deborah Brouwer wrote:
> > > Currently these warnings, as errors, are preventing Tyr driver
> > > from building:
> > >
> > > error: field `device` is never read
> > > --> drivers/gpu/drm/tyr/driver.rs:37:5
> > > |
> > > 36 | pub(crate) struct TyrDriver {
> > > | --------- field in this struct
> > > 37 | device: ARef<TyrDevice>,
> > > | ^^^^^^
> > > |
> > > = note: `-D dead-code` implied by `-D warnings`
> > > = help: to override `-D warnings` add `#[allow(dead_code)]`
> > >
> > > error: fields `mali` and `sram` are never read
> > > --> drivers/gpu/drm/tyr/driver.rs:196:5
> > > |
> > > 195 | struct Regulators {
> > > | ---------- fields in this struct
> > > 196 | mali: Regulator<regulator::Enabled>,
> > > | ^^^^
> > > 197 | sram: Regulator<regulator::Enabled>,
> > > | ^^^^
> > >
> > > error: aborting due to 2 previous errors
> > >
> > > Suppress these errors so that the Tyr driver will build.
> > >
> > > Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
> >
> > I still don't understand why I couldn't reproduce it myself, but
> > assuming it's not just an 1.80.0 issue, below is my review:
>
> I think the problem is not actually the rust compiler version, but commit
> "0242623384c7 rust: driver: let probe() return impl PinInit<Self, Error>"
>
> Tyr probe() used to return a fully initialized Pin<KBox<Self>>, so the
> fields existed in an allocated struct which I suppose counted as
> “reading” the fields. But now Tyr probe() returns just a PinInit
> closure which doesn’t count as reading these fields.
I see.
> > > drivers/gpu/drm/tyr/driver.rs | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
> > > index 2a45d0288825..04c865cb4397 100644
> > > --- a/drivers/gpu/drm/tyr/driver.rs
> > > +++ b/drivers/gpu/drm/tyr/driver.rs
> > > @@ -34,6 +34,7 @@
> > >
> > > #[pin_data(PinnedDrop)]
> > > pub(crate) struct TyrDriver {
> > > + #[allow(dead_code)]
> > > device: ARef<TyrDevice>,
> >
> > Let's use #[expect(dead_code)] so we remember to remove this when a user
> > is added.
>
> Using #[expect(dead_code)] also fails with 'unfulfilled lint expectation'.
> So I could keep #[allow(dead_code)] or maybe just use an underscore
> _driver too with a comment to explain the issue. What do you think?
Ok, let's use _driver for now. If you send a v2, I'll apply it right away.
Alice
next prev parent reply other threads:[~2026-01-23 12:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 0:37 [PATCH] drm/tyr: suppress unread field warnings Deborah Brouwer
2026-01-22 0:58 ` Miguel Ojeda
2026-01-22 2:11 ` Deborah Brouwer
2026-01-22 11:22 ` Mark Brown
2026-01-22 19:46 ` Danilo Krummrich
2026-01-23 15:01 ` Miguel Ojeda
2026-01-23 15:10 ` Alice Ryhl
2026-01-23 15:24 ` Miguel Ojeda
2026-01-23 16:56 ` Gary Guo
2026-01-24 13:14 ` Miguel Ojeda
2026-01-22 8:42 ` Alice Ryhl
2026-01-22 19:05 ` Deborah Brouwer
2026-01-23 12:08 ` Alice Ryhl [this message]
2026-01-22 19:32 ` Gary Guo
2026-01-23 9:18 ` Alice Ryhl
2026-01-23 13:36 ` Miguel Ojeda
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=aXNkzF2bgaj21OsI@google.com \
--to=aliceryhl@google.com \
--cc=boris.brezillon@collabora.com \
--cc=broonie@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deborah.brouwer@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=rust-for-linux@vger.kernel.org \
/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