mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maurice Hieronymus <mhi@mailbox.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: Alice Ryhl <aliceryhl@google.com>,
	Alexandre Courbot <acourbot@nvidia.com>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	nouveau@lists.freedesktop.org,  dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpu: nova-core: use stable name() method in Chipset Display impl
Date: Sat, 03 Jan 2026 11:44:09 +0100	[thread overview]
Message-ID: <fdaf272295d90d2d051d4997a99ee899c45d7b67.camel@mailbox.org> (raw)
In-Reply-To: <DFEV1P747QKG.3O75MCC6HFYK4@kernel.org>

On Sat, 2026-01-03 at 10:52 +0100, Danilo Krummrich wrote:
> On Thu Jan 1, 2026 at 7:41 PM CET, Maurice Hieronymus wrote:
> > Chipset's Display was using Debug formatting ("{self:?}"), which is
> > not
> > guaranteed to be stable. Use the existing name() method instead,
> > which
> > provides stable lowercase strings suitable for firmware path
> > generation.
> > 
> > Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
> > ---
> >  drivers/gpu/nova-core/gpu.rs | 10 +---------
> >  1 file changed, 1 insertion(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-
> > core/gpu.rs
> > index 629c9d2dc994..be8c882338ea 100644
> > --- a/drivers/gpu/nova-core/gpu.rs
> > +++ b/drivers/gpu/nova-core/gpu.rs
> > @@ -107,17 +107,9 @@ pub(crate) fn arch(&self) -> Architecture {
> >      }
> >  }
> >  
> > -// TODO
> > -//
> > -// The resulting strings are used to generate firmware paths,
> > hence the
> > -// generated strings have to be stable.
> > -//
> > -// Hence, replace with something like strum_macros
> > derive(Display).
> > -//
> > -// For now, redirect to fmt::Debug for convenience.
> >  impl fmt::Display for Chipset {
> >      fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
> > -        write!(f, "{self:?}")
> > +        write!(f, "{}", self.name())
> >      }
> >  }
> 
> This also converts the printed string to lowercase. While this is not
> that big a
> deal, the solution we are looking for instead is what the TODO
> comment says: be
> able to derive a Display implementation (for enums).
> 
> Now that we have syn in the kernel, this seems quite straight forward
> to
> implement. Are you interested in working on this instead?
> 
Definitely!

The Display implementation should print the enum value as it is,
without changing the case, correct?

I will have a look into that and send a new patch set in the next few
days.

> Thanks,
> Danilo

      reply	other threads:[~2026-01-03 10:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-01 18:41 Maurice Hieronymus
2026-01-03  9:52 ` Danilo Krummrich
2026-01-03 10:44   ` Maurice Hieronymus [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=fdaf272295d90d2d051d4997a99ee899c45d7b67.camel@mailbox.org \
    --to=mhi@mailbox.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=simona@ffwll.ch \
    /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

all inboxes | Powered by JetHome®