lkml.org 
[lkml]   [2011]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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: Ingo Molnar <mingo@elte.hu>
---
include/linux/mutex.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-3.0-rc7.orig/include/linux/mutex.h 2011-05-30 20:45:24.000000000 +0200
+++ linux-3.0-rc7/include/linux/mutex.h 2011-07-16 15:42:38.000000000 +0200
@@ -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

--
Jean Delvare


\
 
 \ /
  Last update: 2011-07-16 17:45    [W:1.241 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site