Skip to contentSkip to conversation

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

PATCH Applied Gary Guo 3 participants 3 messages Sep 10 – Oct 2

Subsystems (2)
lore
Share & tools
lore

Gary Guo

author
#0 lore raw

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

From: Gary Guo <[email protected]>

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.

---
 rust/kernel/bitfield.rs | 1 -
 1 file changed, 1 deletion(-)
rust/kernel/bitfield.rs +0 -1
index 15c78790e151..8d7d78175336 100644
@@ -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

Signature · 1 line
2.54.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gary Guo

From: Gary Guo <[email protected]>

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.

Quoted 5 lines

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.

Thanks!

Applied
#2 lore raw
In reply to Gary Guo
Quoted 8 lines · Gary Guo

From: Gary Guo <[email protected]>

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.

Quoted 5 lines

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.

Applied to rust-next -- thanks everyone!

Cheers,
Miguel