From 4582c0a4866ea70c35aa9279e1f91834d3348a93 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 16 Jul 2011 17:42:00 +0200 Subject: 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 Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20110716174200.41002352@endymion.delvare Signed-off-by: Ingo Molnar --- include/linux/mutex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/mutex.h') diff --git a/include/linux/mutex.h b/include/linux/mutex.h index a940fe435aca..7f87217e9d1f 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -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 -- cgit v1.2.1