[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240307024034.1548605-2-gnstark@salutedevices.com>
Date: Thu, 7 Mar 2024 05:40:25 +0300
From: George Stark <gnstark@...utedevices.com>
To: <andy.shevchenko@...il.com>, <pavel@....cz>, <lee@...nel.org>,
<vadimp@...dia.com>, <mpe@...erman.id.au>, <npiggin@...il.com>,
<christophe.leroy@...roup.eu>, <hdegoede@...hat.com>,
<mazziesaccount@...il.com>, <peterz@...radead.org>, <mingo@...hat.com>,
<will@...nel.org>, <longman@...hat.com>, <boqun.feng@...il.com>,
<nikitos.tr@...il.com>, <kabel@...nel.org>
CC: <linux-leds@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linuxppc-dev@...ts.ozlabs.org>, <kernel@...utedevices.com>, George Stark
<gnstark@...utedevices.com>
Subject: [PATCH v5 01/10] locking/mutex: move mutex_destroy() definition lower
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@...utedevices.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(-)
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.
--
2.25.1
Powered by blists - more mailing lists