diff mbox series

[v5,01/10] locking/mutex: move mutex_destroy() definition lower

Message ID 20240307024034.1548605-2-gnstark@salutedevices.com
State New
Headers show
Series devm_led_classdev_register() usage problem | expand

Commit Message

George Stark March 7, 2024, 2:40 a.m. UTC
mutex_destroy() definition is located in the middle of the code related
purely to mutex initialization so place it separately after mutex_init()

Signed-off-by: George Stark <gnstark@salutedevices.com>
---
Hello Waiman. This is helper patch to make resulting mutex.h look like we discussed
it in December. It was in you cleanup patch at first but slept away somehow

 include/linux/mutex.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

--
2.25.1
diff mbox series

Patch

diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 67edc4ca2bee..f7611c092db7 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -37,14 +37,10 @@ 
 # define __DEBUG_MUTEX_INITIALIZER(lockname)				\
 	, .magic = &lockname

-extern void mutex_destroy(struct mutex *lock);
-
 #else

 # define __DEBUG_MUTEX_INITIALIZER(lockname)

-static inline void mutex_destroy(struct mutex *lock) {}
-
 #endif

 #ifndef CONFIG_PREEMPT_RT
@@ -117,6 +113,16 @@  do {							\
 } while (0)
 #endif /* CONFIG_PREEMPT_RT */

+#ifdef CONFIG_DEBUG_MUTEXES
+
+void mutex_destroy(struct mutex *lock);
+
+#else
+
+static inline void mutex_destroy(struct mutex *lock) {}
+
+#endif
+
 /*
  * See kernel/locking/mutex.c for detailed documentation of these APIs.
  * Also see Documentation/locking/mutex-design.rst.