Re: [PATCH v4] rust: add global lock support

Andreas Hindborg
2024-10-10T14:05:29Z

"Benno Lossin" <benno.lossin@proton.me> writes:

>
> Also,
>
> error: type `__static_lock_ty_VALUE` should have an upper camel case name
> --> rust/kernel/sync/lock/global.rs:100:18
> |
> 100 | type [< __static_lock_ty_ $name >] = $valuety;
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `StaticLockTyValue`
>

How did you manage to get these errors? The only thing I get from clippy
is this:

CC rust/doctests_kernel_generated_kunit.o
warning: question mark operator is useless here
--> rust/doctests_kernel_generated.rs:4744:1
|
4744 | / kernel::sync::global_lock! {
4745 | | // SAFETY: Initialized in module initializer before first use.
4746 | | static MY_COUNTER: Mutex<u32> = unsafe { uninit };
4747 | | value: 0;
4748 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `-W clippy::needless-question-mark` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_question_mark)]`
= note: this warning originates in the macro `$crate::global_lock` which comes from the expansion of the macro `kernel::sync::global_lock` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: 1 warning emitted

BR Andreas