From: Jean Delvare Date: Sat, 16 Jul 2011 15:42:00 +0000 (+0200) Subject: mutex: Make mutex_destroy() an inline function X-Git-Tag: upstream/snapshot3+hdmi~9610^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4582c0a4866ea70c35aa9279e1f91834d3348a93;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 --- diff --git a/include/linux/mutex.h b/include/linux/mutex.h index a940fe4..7f87217 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