Skip to content

Commit

Permalink
spinlock: macroize assert_spin_locked to avoid bug.h dependency
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Gortmaker committed Feb 28, 2012
1 parent f649e93 commit 4ebc1b4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/linux/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4ebc1b4

Please sign in to comment.