]> Git Repo - linux.git/commitdiff
mutex: Make mutex_destroy() an inline function
authorJean Delvare <[email protected]>
Sat, 16 Jul 2011 15:42:00 +0000 (17:42 +0200)
committerIngo Molnar <[email protected]>
Thu, 21 Jul 2011 07:36:09 +0000 (09:36 +0200)
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.

Signed-off-by: Jean Delvare <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/linux/mutex.h

index a940fe435acac1e6b48774686cdd39c9f0cd652d..7f87217e9d1f65dd50ebcfd98e08391d7f65a7d2 100644 (file)
@@ -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
This page took 0.058732 seconds and 4 git commands to generate.