lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1327632272-12928-3-git-send-email-paul.gortmaker@windriver.com>
Date:	Thu, 26 Jan 2012 21:44:27 -0500
From:	Paul Gortmaker <paul.gortmaker@...driver.com>
To:	torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
	gregkh@...e.de, rmk+kernel@....linux.org.uk
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH 2/7] spinlock: macroize assert_spin_locked to avoid bug.h dependency

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@...driver.com>
CC: Thomas Gleixner <tglx@...utronix.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ