public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jean Delvare <khali@linux-fr.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	a.p.zijlstra@chello.nl, khali@linux-fr.org, tglx@linutronix.de,
	mingo@elte.hu
Subject: [tip:core/locking] mutex: Make mutex_destroy() an inline function
Date: Thu, 21 Jul 2011 10:09:19 GMT	[thread overview]
Message-ID: <tip-4582c0a4866ea70c35aa9279e1f91834d3348a93@git.kernel.org> (raw)
In-Reply-To: <20110716174200.41002352@endymion.delvare>

Commit-ID:  4582c0a4866ea70c35aa9279e1f91834d3348a93
Gitweb:     http://git.kernel.org/tip/4582c0a4866ea70c35aa9279e1f91834d3348a93
Author:     Jean Delvare <khali@linux-fr.org>
AuthorDate: Sat, 16 Jul 2011 17:42:00 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 21 Jul 2011 09:36:09 +0200

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>
---
 include/linux/mutex.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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

      reply	other threads:[~2011-07-21 10:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-16 15:42 [PATCH] mutex: Make mutex_destroy an inline function Jean Delvare
2011-07-21 10:09 ` tip-bot for Jean Delvare [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-4582c0a4866ea70c35aa9279e1f91834d3348a93@git.kernel.org \
    --to=khali@linux-fr.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox