[PATCH] rust: bitfield: remove unnecessary `#[allow]`

Gary Guo posted 1 patch 2 weeks ago
rust/kernel/bitfield.rs | 1 -
1 file changed, 1 deletion(-)
[PATCH] rust: bitfield: remove unnecessary `#[allow]`
Posted by Gary Guo 2 weeks ago
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
Re: [PATCH] rust: bitfield: remove unnecessary `#[allow]`
Posted by Alexandre Courbot 2 weeks ago
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>