public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Gary Guo" <gary@garyguo.net>
Cc: "Daniel Almeida" <daniel.almeida@collabora.com>,
	"Dirk Behme" <dirk.behme@gmail.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Steven Price" <steven.price@arm.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] rust/drm: tyr: Convert to the register!() macro
Date: Fri, 16 Jan 2026 14:58:08 +0100	[thread overview]
Message-ID: <DFQ2ETAYEE9B.1B3P7RH733YM7@kernel.org> (raw)
In-Reply-To: <DFQ2B06J0U0T.M8K7D98WCZYI@garyguo.net>

On Fri Jan 16, 2026 at 2:53 PM CET, Gary Guo wrote:
> On Fri Jan 16, 2026 at 1:38 PM GMT, Daniel Almeida wrote:
>>
>>>>> 
>>>>> Is there any reason why you replace the UPPERCASE register names with
>>>>> CamelCase ones?
>>>>> 
>>>>> I was under the impression that we want to use UPPERCASE for register
>>>>> names. Like in nova
>>>>> 
>>>>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/nova-core/regs.rs
>>>> 
>>>> Not really. UPPERCASE for non-const items will trigger the linter. The Nova
>>>> people chose to #[allow] this to align with OpenRM and, IIRC from the LPC
>>>> discussions, their registers are automatically generated from some internal
>>>> docs.
>>>> 
>>>> We have only a few, we can simply convert them to CamelCase.
>>> 
>>> Frankly, register names do look nicer in UPPER_CASE, especially that they're in
>>> many cases, packed with acronyms.
>>> 
>>> Best,
>>> Gary
>>> 
>>
>> I don’t have an opinion here, to be honest. I think CamelCase does make it
>> easier on the eyes since our register names look quite simple,

I think you want to go with what your datasheets do, it is much easier for
people if names are consistent.

>
> You're on the lucky side! Most hardware don't enjoy that, especially if
> you want to match register names with the ones documented on the datasheet.
>
>> specially when
>> compared to Nova. However, I can switch to UPPER_CASE and add an
>> #![allow(non_camel_case_types)] if more people chime in.
>
> I wonder if we should just such allow `non_camel_case_types` to the register
> macro? I don't have an opinion on whether we want to enforce using UPPER_CASE,
> but at least I think we should allow it.

I fully agree here. I would not enforce it either, but given that the absolute
majority of datasheets uses UPPER_CASE for register names, we should allow it in
the register!() macro.

  reply	other threads:[~2026-01-16 13:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 22:53 [PATCH] rust/drm: tyr: Convert to the register!() macro Daniel Almeida
2026-01-15 10:35 ` Steven Price
2026-01-16 12:12   ` Daniel Almeida
2026-01-15 17:05 ` Dirk Behme
2026-01-16  7:10   ` Dirk Behme
2026-01-16 12:26     ` Daniel Almeida
2026-01-16 14:56       ` Danilo Krummrich
2026-01-16 15:19       ` Alexandre Courbot
2026-01-16 15:25         ` Danilo Krummrich
2026-01-16 12:23   ` Daniel Almeida
2026-01-16 13:00     ` Gary Guo
2026-01-16 13:38       ` Daniel Almeida
2026-01-16 13:53         ` Gary Guo
2026-01-16 13:58           ` Danilo Krummrich [this message]
2026-01-16 13:00     ` Dirk Behme
2026-01-16 13:59       ` Daniel Almeida

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=DFQ2ETAYEE9B.1B3P7RH733YM7@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=daniel.almeida@collabora.com \
    --cc=dirk.behme@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tmgross@umich.edu \
    --cc=tzimmermann@suse.de \
    /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