mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Maurice Hieronymus" <mhi@mailbox.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 10:52:33 +0100	[thread overview]
Message-ID: <DFEV1P747QKG.3O75MCC6HFYK4@kernel.org> (raw)
In-Reply-To: <20260101184137.80445-1-mhi@mailbox.org>

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?

Thanks,
Danilo

  reply	other threads:[~2026-01-03  9:52 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 [this message]
2026-01-03 10:44   ` Maurice Hieronymus

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=DFEV1P747QKG.3O75MCC6HFYK4@kernel.org \
    --to=dakr@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhi@mailbox.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®