summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2025-07-19 19:25:53 +0200
committerPeter Zijlstra <peterz@infradead.org>2025-07-19 19:25:53 +0200
commitba28549bad8ab2b09264ebc8c2ca24af3537ee52 (patch)
tree202ce15fa4875018ae4cde5fb9a5c703737f35ec /include
parent7ff495e26a39f3e7a3d4058df59b5b6d6f943cab (diff)
parent7a3cedafccf8e7d038ad4cfec5b38052647ceac5 (diff)
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 'include')
-rw-r--r--include/linux/lockdep_types.h2
-rw-r--r--include/linux/mutex.h11
2 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h
index 9f361d3ab9d9..eae115a26488 100644
--- a/include/linux/lockdep_types.h
+++ b/include/linux/lockdep_types.h
@@ -175,7 +175,7 @@ struct lock_class_stats {
unsigned long bounces[nr_bounce_types];
};
-struct lock_class_stats lock_stats(struct lock_class *class);
+void lock_stats(struct lock_class *class, struct lock_class_stats *stats);
void clear_lock_stats(struct lock_class *class);
#endif
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index a039fa8c1780..00afd341d293 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -126,11 +126,11 @@ do { \
#ifdef CONFIG_DEBUG_MUTEXES
-int __devm_mutex_init(struct device *dev, struct mutex *lock);
+int __must_check __devm_mutex_init(struct device *dev, struct mutex *lock);
#else
-static inline int __devm_mutex_init(struct device *dev, struct mutex *lock)
+static inline int __must_check __devm_mutex_init(struct device *dev, struct mutex *lock)
{
/*
* When CONFIG_DEBUG_MUTEXES is off mutex_destroy() is just a nop so
@@ -141,14 +141,17 @@ static inline int __devm_mutex_init(struct device *dev, struct mutex *lock)
#endif
-#define devm_mutex_init(dev, mutex) \
+#define __mutex_init_ret(mutex) \
({ \
typeof(mutex) mutex_ = (mutex); \
\
mutex_init(mutex_); \
- __devm_mutex_init(dev, mutex_); \
+ mutex_; \
})
+#define devm_mutex_init(dev, mutex) \
+ __devm_mutex_init(dev, __mutex_init_ret(mutex))
+
/*
* See kernel/locking/mutex.c for detailed documentation of these APIs.
* Also see Documentation/locking/mutex-design.rst.