diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-08-07 09:55:19 +0200 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-08-07 09:55:19 +0200 |
| commit | 0074281bb6316108e0cff094bd4db78ab3eee236 (patch) | |
| tree | 9b5eeb12eed9fd2a8aa329043da7f5150ceb938c /rust/kernel/sync.rs | |
| parent | gpio: mlxbf2: use platform_get_irq_optional() (diff) | |
| parent | Merge tag 'input-for-v6.17-rc0' of git://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
| download | linux-0074281bb6316108e0cff094bd4db78ab3eee236.tar.gz linux-0074281bb6316108e0cff094bd4db78ab3eee236.zip | |
Merge commit '6e64f4580381e32c06ee146ca807c555b8f73e24' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into gpio/for-next
Diffstat (limited to 'rust/kernel/sync.rs')
| -rw-r--r-- | rust/kernel/sync.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rust/kernel/sync.rs b/rust/kernel/sync.rs index c23a12639924..00f9b558a3ad 100644 --- a/rust/kernel/sync.rs +++ b/rust/kernel/sync.rs @@ -10,6 +10,7 @@ use crate::types::Opaque; use pin_init; mod arc; +pub mod aref; pub mod completion; mod condvar; pub mod lock; @@ -41,7 +42,7 @@ impl LockClassKey { /// Initializes a dynamically allocated lock class key. In the common case of using a /// statically allocated lock class key, the static_lock_class! macro should be used instead. /// - /// # Example + /// # Examples /// ``` /// # use kernel::c_str; /// # use kernel::alloc::KBox; @@ -95,8 +96,11 @@ impl PinnedDrop for LockClassKey { macro_rules! static_lock_class { () => {{ static CLASS: $crate::sync::LockClassKey = - // SAFETY: lockdep expects uninitialized memory when it's handed a statically allocated - // lock_class_key + // Lockdep expects uninitialized memory when it's handed a statically allocated `struct + // lock_class_key`. + // + // SAFETY: `LockClassKey` transparently wraps `Opaque` which permits uninitialized + // memory. unsafe { ::core::mem::MaybeUninit::uninit().assume_init() }; $crate::prelude::Pin::static_ref(&CLASS) }}; |
