Skip to content

Commit

Permalink
mutex: Make mutex_destroy() an inline function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Ingo Molnar committed Jul 21, 2011
1 parent 732375c commit 4582c0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4582c0a

Please sign in to comment.