rust: bitfield: remove unnecessary `#[allow]`
Subsystems (2)
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
@@ -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
Quoted 7 lines · Gary Guo
From: Gary Guo <[email protected]>
The
#[allow(non_camel_case_types)]was there because register names can be commonlySCREAMING_CASEand 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 ofbitfield!insideregister!macro carry this annotation.Signed-off-by Gary Guo <[email protected]>
Thanks!
Miguel Ojeda
AppliedQuoted 8 lines · Gary Guo
From: Gary Guo <[email protected]>
The
#[allow(non_camel_case_types)]was there because register names can be commonlySCREAMING_CASEand 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 ofbitfield!insideregister!macro carry this annotation.Signed-off-by Gary Guo <[email protected]>
Applied to rust-next -- thanks everyone!
Cheers,
Miguel