diff options
| author | 2025-07-19 19:25:53 +0200 | |
|---|---|---|
| committer | 2025-07-19 19:25:53 +0200 | |
| commit | ba28549bad8ab2b09264ebc8c2ca24af3537ee52 (patch) | |
| tree | 202ce15fa4875018ae4cde5fb9a5c703737f35ec /rust/kernel | |
| parent | local_lock: Move this_cpu_ptr() notation from internal to main header (diff) | |
| parent | lockdep: Speed up lockdep_unregister_key() with expedited RCU synchronization (diff) | |
| download | wireguard-linux-ba28549bad8ab2b09264ebc8c2ca24af3537ee52.tar.xz wireguard-linux-ba28549bad8ab2b09264ebc8c2ca24af3537ee52.zip | |
Merge tag 'lockdep-for-tip.2025.07.16' of git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux into locking/core
Locking changes for v6.17:
- General
- Mark devm_mutex_init() as __must_check
- Add #[must_use] to Lock::try_lock()
- Remove OWNER_SPINNABLE in rwsem
- Remove redundant #ifdefs in mutex
- Lockdep
- Avoid returning struct in lock_stats()
- Change `static const` into enum for LOCKF_*_IRQ_*
- Temporarily use synchronize_rcu_expedited() in
lockdep_unregister_key() to speed things up.
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'rust/kernel')
| -rw-r--r-- | rust/kernel/sync/lock.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rust/kernel/sync/lock.rs b/rust/kernel/sync/lock.rs index e82fa5be289c..27202beef90c 100644 --- a/rust/kernel/sync/lock.rs +++ b/rust/kernel/sync/lock.rs @@ -175,6 +175,8 @@ impl<T: ?Sized, B: Backend> Lock<T, B> { /// Tries to acquire the lock. /// /// Returns a guard that can be used to access the data protected by the lock if successful. + // `Option<T>` is not `#[must_use]` even if `T` is, thus the attribute is needed here. + #[must_use = "if unused, the lock will be immediately unlocked"] pub fn try_lock(&self) -> Option<Guard<'_, T, B>> { // SAFETY: The constructor of the type calls `init`, so the existence of the object proves // that `init` was called. |
