mutex: Make mutex_destroy an inline function
PATCH 1/1 mutex: Make mutex_destroy an inline function
The non-debug variant of mutex_destroy is a no-op, currently implemented as a macro which does nothing. This approach fails to check the type of the parameter, so an error would only show when debugging gets enabled. Using an inline function instead, offers type checking for earlier bug catching.
--- include/linux/mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mutex.h +1 -1
@@ -92,7 +92,7 @@ do { \ \ __mutex_init((mutex), #mutex, &__key); \ } while (0) -# define mutex_destroy (mutex) do { } while (0) +static inline void mutex_destroy (struct mutex *lock) {}#endif #ifdef CONFIG_DEBUG_LOCK_ALLOC
Signature · 1 line
Jean Delvare
[tip:core/locking] mutex: Make mutex_destroy() an inline function
Commit-ID: 4582c0a4866ea70c35aa9279e1f91834d3348a93 Gitweb: http://git.kernel.org/tip/4582c0a4866ea70c35aa9279e1f91834d3348a93 Author: Jean Delvare <[email protected]> AuthorDate: Sat, 16 Jul 2011 17:42:00 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 21 Jul 2011 09:36:09 +0200
mutex: Make mutex_destroy() an inline function
The non-debug variant of mutex_destroy is a no-op, currently implemented as a macro which does nothing. This approach fails to check the type of the parameter, so an error would only show when debugging gets enabled. Using an inline function instead, offers type checking for earlier bug catching.
--- include/linux/mutex.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/mutex.h +1 -1
@@ -92,7 +92,7 @@ do { \ \ __mutex_init((mutex), #mutex, &__key); \ } while (0) -# define mutex_destroy (mutex) do { } while (0) +static inline void mutex_destroy (struct mutex *lock) {}#endif #ifdef CONFIG_DEBUG_LOCK_ALLOC