aboutsummaryrefslogtreecommitdiffstats
path: root/rust/kernel/sync/lock.rs
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2025-09-15 10:23:28 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2025-09-15 10:23:28 +0200
commitb4d90dbc4c1bc4bd3eb2d2989330af0eb95c98e8 (patch)
tree5670a6d87e7cb5c421809babf9dc9e72ff40f8ae /rust/kernel/sync/lock.rs
parentdrm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file (diff)
parentMerge tag 'v6.17-rc6' into drm-next (diff)
downloadlinux-b4d90dbc4c1bc4bd3eb2d2989330af0eb95c98e8.tar.gz
linux-b4d90dbc4c1bc4bd3eb2d2989330af0eb95c98e8.zip
Merge drm/drm-next into drm-misc-next-fixes
Backmerging to drm-misc-next-fixes to get features and fixes from v6.17-rc6. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'rust/kernel/sync/lock.rs')
-rw-r--r--rust/kernel/sync/lock.rs2
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.