diff options
author | Pavel Roskin <proski@gnu.org> | 2007-02-10 01:46:37 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 11:18:07 -0800 |
commit | c75fb88dbcc470e6041a20b1457b4835b9a0a48a (patch) | |
tree | efe63dd4feaccc0007c9dccadec057c0bca7d5d9 /include/linux/spinlock.h | |
parent | aa0f030374228407bc4e3f5482eeab787ba53c8a (diff) | |
download | op-kernel-dev-c75fb88dbcc470e6041a20b1457b4835b9a0a48a.zip op-kernel-dev-c75fb88dbcc470e6041a20b1457b4835b9a0a48a.tar.gz |
[PATCH] Fix sparse annotation of spin unlock macros in one case
SMP systems without premption and spinlock debugging enabled use unlock
macros that don't tell sparse that the lock is being released. Add sparse
annotations in this case.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/spinlock.h')
-rw-r--r-- | include/linux/spinlock.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 94b767d..61fef37 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -228,15 +228,30 @@ do { \ # define read_unlock_irq(lock) _read_unlock_irq(lock) # define write_unlock_irq(lock) _write_unlock_irq(lock) #else -# define spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock) -# define read_unlock(lock) __raw_read_unlock(&(lock)->raw_lock) -# define write_unlock(lock) __raw_write_unlock(&(lock)->raw_lock) -# define spin_unlock_irq(lock) \ - do { __raw_spin_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) -# define read_unlock_irq(lock) \ - do { __raw_read_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) -# define write_unlock_irq(lock) \ - do { __raw_write_unlock(&(lock)->raw_lock); local_irq_enable(); } while (0) +# define spin_unlock(lock) \ + do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0) +# define read_unlock(lock) \ + do {__raw_read_unlock(&(lock)->raw_lock); __release(lock); } while (0) +# define write_unlock(lock) \ + do {__raw_write_unlock(&(lock)->raw_lock); __release(lock); } while (0) +# define spin_unlock_irq(lock) \ +do { \ + __raw_spin_unlock(&(lock)->raw_lock); \ + __release(lock); \ + local_irq_enable(); \ +} while (0) +# define read_unlock_irq(lock) \ +do { \ + __raw_read_unlock(&(lock)->raw_lock); \ + __release(lock); \ + local_irq_enable(); \ +} while (0) +# define write_unlock_irq(lock) \ +do { \ + __raw_write_unlock(&(lock)->raw_lock); \ + __release(lock); \ + local_irq_enable(); \ +} while (0) #endif #define spin_unlock_irqrestore(lock, flags) \ |