mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rust: bitfield: remove unnecessary `#[allow]`
@ 2026-09-10 17:05 Gary Guo
  2026-09-11  5:19 ` Alexandre Courbot
  0 siblings, 1 reply; 2+ messages in thread
From: Gary Guo @ 2026-09-10 17:05 UTC (permalink / raw)
  To: Alexandre Courbot, Yury Norov, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich, Daniel Almeida,
	Tamir Duberstein, Onur Özkan
  Cc: rust-for-linux, linux-kernel

From: Gary Guo <gary@garyguo.net>

The `#[allow(non_camel_case_types)]` was there because register names can
be commonly SCREAMING_CASE and thus not CamelCase. However, when a bitfield
type is created by itself, this justification does not apply. Thus, remove
it.

Users that want to use non-standard styles can add the `#[allow]`
themselves. For example, the invocation of `bitfield!` inside `register!`
macro carry this annotation.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 rust/kernel/bitfield.rs | 1 -
 1 file changed, 1 deletion(-)

diff --git a/rust/kernel/bitfield.rs b/rust/kernel/bitfield.rs
index 15c78790e151..8d7d78175336 100644
--- a/rust/kernel/bitfield.rs
+++ b/rust/kernel/bitfield.rs
@@ -295,7 +295,6 @@ macro_rules! bitfield {
         $(#[$attr:meta])* $vis:vis struct $name:ident($storage:ty) { $($fields:tt)* }
     ) => {
         $crate::bitfield!(@core
-            #[allow(non_camel_case_types)]
             $(#[$attr])* $vis $name $storage
         );
         $crate::bitfield!(@fields $vis $name $storage { $($fields)* });

base-commit: 73e5616f3d197c1af5a04a481fe0f13aa3913bd1
-- 
2.54.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rust: bitfield: remove unnecessary `#[allow]`
  2026-09-10 17:05 [PATCH] rust: bitfield: remove unnecessary `#[allow]` Gary Guo
@ 2026-09-11  5:19 ` Alexandre Courbot
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Courbot @ 2026-09-11  5:19 UTC (permalink / raw)
  To: Gary Guo
  Cc: Gary Guo, Yury Norov, Miguel Ojeda, Boqun Feng,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Onur Özkan, rust-for-linux, linux-kernel

On Fri Sep 11, 2026 at 2:05 AM JST, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> The `#[allow(non_camel_case_types)]` was there because register names can
> be commonly SCREAMING_CASE and thus not CamelCase. However, when a bitfield
> type is created by itself, this justification does not apply. Thus, remove
> it.
>
> Users that want to use non-standard styles can add the `#[allow]`
> themselves. For example, the invocation of `bitfield!` inside `register!`
> macro carry this annotation.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Thanks!

Acked-by: Alexandre Courbot <acourbot@nvidia.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-11  5:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-10 17:05 [PATCH] rust: bitfield: remove unnecessary `#[allow]` Gary Guo
2026-09-11  5:19 ` Alexandre Courbot

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®