Browse Source

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.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110716174200.41002352@endymion.delvare
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Jean Delvare 14 years ago
parent
commit
4582c0a486
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/linux/mutex.h

+ 1 - 1
include/linux/mutex.h

@@ -92,7 +92,7 @@ do {							\
 							\
 							\
 	__mutex_init((mutex), #mutex, &__key);		\
 	__mutex_init((mutex), #mutex, &__key);		\
 } while (0)
 } while (0)
-# define mutex_destroy(mutex)				do { } while (0)
+static inline void mutex_destroy(struct mutex *lock) {}
 #endif
 #endif
 
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 #ifdef CONFIG_DEBUG_LOCK_ALLOC