linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: torvalds@linux-foundation.org, akpm@linux-foundation.org,
	gregkh@suse.de, rmk+kernel@arm.linux.org.uk
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 2/7] spinlock: macroize assert_spin_locked to avoid bug.h dependency
Date: Thu, 26 Jan 2012 21:44:27 -0500	[thread overview]
Message-ID: <1327632272-12928-3-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1327632272-12928-1-git-send-email-paul.gortmaker@windriver.com>

In spinlock_api_smp.h we find a define for assert_raw_spin_locked
[which uses BUG_ON].   Then assert_spin_locked (as an inline) uses
it, meaning we need bug.h  But rather than put linux/bug.h in such
a highly used file like spinlock.h, we can just make the un-raw
version also a macro.  Then the required bug.h presence is limited
just to those few files who are actually doing the assert testing.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/spinlock.h |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 7df6c17..3632390 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -375,10 +375,7 @@ static inline int spin_can_lock(spinlock_t *lock)
 	return raw_spin_can_lock(&lock->rlock);
 }
 
-static inline void assert_spin_locked(spinlock_t *lock)
-{
-	assert_raw_spin_locked(&lock->rlock);
-}
+#define assert_spin_locked(lock)	assert_raw_spin_locked(&(lock)->rlock)
 
 /*
  * Pull the atomic_t declaration:
-- 
1.7.7.2

  parent reply	other threads:[~2012-01-27  2:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27  2:44 [RFC - PATCH 0/7] consolidation of BUG support code Paul Gortmaker
2012-01-27  2:44 ` Paul Gortmaker
2012-01-27  2:44 ` [PATCH 1/7] x86: relocate get/set debugreg fcns to include/asm/debugreg Paul Gortmaker
2012-01-27  2:44   ` Paul Gortmaker
2012-01-27 11:51   ` Ingo Molnar
2012-01-27 11:51     ` Ingo Molnar
2012-01-27 19:28     ` Paul Gortmaker
2012-01-27  2:44 ` Paul Gortmaker [this message]
2012-01-27  2:44   ` [PATCH 2/7] spinlock: macroize assert_spin_locked to avoid bug.h dependency Paul Gortmaker
2012-01-27  2:44 ` [PATCH 3/7] lib: fix implicit users of kernel.h for TAINT_WARN Paul Gortmaker
2012-01-27  2:44   ` Paul Gortmaker
2012-01-27  2:44 ` [PATCH 4/7] bug.h: add include of it to various implicit C users Paul Gortmaker
2012-01-27  2:44 ` [PATCH 5/7] BUG: headers with BUG/BUG_ON etc. need linux/bug.h Paul Gortmaker
2012-01-27  2:44 ` [PATCH 6/7] bug: consolidate BUILD_BUG_ON with other bug code Paul Gortmaker
2012-01-27  2:44   ` Paul Gortmaker
2012-01-27  2:44 ` [PATCH 7/7] kernel.h: doesn't explicitly use bug.h, so don't include it Paul Gortmaker
2012-01-27  2:44   ` Paul Gortmaker
2012-01-27  5:52 ` [RFC - PATCH 0/7] consolidation of BUG support code Stephen Rothwell
2012-01-27  5:52   ` Stephen Rothwell
2012-01-27 19:23   ` Paul Gortmaker

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=1327632272-12928-3-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).