Commit 3a0e36b0 authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Annotate UP spinlock stubs with lock annotations.

This way you can do a checking run on UP too - even if the
locks don't actually _matter_, they should still be right,
I'd hope.
parent a4b13f2f
...@@ -235,36 +235,42 @@ typedef struct { ...@@ -235,36 +235,42 @@ typedef struct {
do { \ do { \
preempt_disable(); \ preempt_disable(); \
_raw_spin_lock(lock); \ _raw_spin_lock(lock); \
__acquire(lock); \
} while(0) } while(0)
#define _write_lock(lock) \ #define _write_lock(lock) \
do { \ do { \
preempt_disable(); \ preempt_disable(); \
_raw_write_lock(lock); \ _raw_write_lock(lock); \
__acquire(lock); \
} while(0) } while(0)
#define _read_lock(lock) \ #define _read_lock(lock) \
do { \ do { \
preempt_disable(); \ preempt_disable(); \
_raw_read_lock(lock); \ _raw_read_lock(lock); \
__acquire(lock); \
} while(0) } while(0)
#define _spin_unlock(lock) \ #define _spin_unlock(lock) \
do { \ do { \
_raw_spin_unlock(lock); \ _raw_spin_unlock(lock); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while (0) } while (0)
#define _write_unlock(lock) \ #define _write_unlock(lock) \
do { \ do { \
_raw_write_unlock(lock); \ _raw_write_unlock(lock); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while(0) } while(0)
#define _read_unlock(lock) \ #define _read_unlock(lock) \
do { \ do { \
_raw_read_unlock(lock); \ _raw_read_unlock(lock); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while(0) } while(0)
#define _spin_lock_irqsave(lock, flags) \ #define _spin_lock_irqsave(lock, flags) \
...@@ -272,6 +278,7 @@ do { \ ...@@ -272,6 +278,7 @@ do { \
local_irq_save(flags); \ local_irq_save(flags); \
preempt_disable(); \ preempt_disable(); \
_raw_spin_lock(lock); \ _raw_spin_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _spin_lock_irq(lock) \ #define _spin_lock_irq(lock) \
...@@ -279,6 +286,7 @@ do { \ ...@@ -279,6 +286,7 @@ do { \
local_irq_disable(); \ local_irq_disable(); \
preempt_disable(); \ preempt_disable(); \
_raw_spin_lock(lock); \ _raw_spin_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _spin_lock_bh(lock) \ #define _spin_lock_bh(lock) \
...@@ -286,6 +294,7 @@ do { \ ...@@ -286,6 +294,7 @@ do { \
local_bh_disable(); \ local_bh_disable(); \
preempt_disable(); \ preempt_disable(); \
_raw_spin_lock(lock); \ _raw_spin_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _read_lock_irqsave(lock, flags) \ #define _read_lock_irqsave(lock, flags) \
...@@ -293,6 +302,7 @@ do { \ ...@@ -293,6 +302,7 @@ do { \
local_irq_save(flags); \ local_irq_save(flags); \
preempt_disable(); \ preempt_disable(); \
_raw_read_lock(lock); \ _raw_read_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _read_lock_irq(lock) \ #define _read_lock_irq(lock) \
...@@ -300,6 +310,7 @@ do { \ ...@@ -300,6 +310,7 @@ do { \
local_irq_disable(); \ local_irq_disable(); \
preempt_disable(); \ preempt_disable(); \
_raw_read_lock(lock); \ _raw_read_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _read_lock_bh(lock) \ #define _read_lock_bh(lock) \
...@@ -307,6 +318,7 @@ do { \ ...@@ -307,6 +318,7 @@ do { \
local_bh_disable(); \ local_bh_disable(); \
preempt_disable(); \ preempt_disable(); \
_raw_read_lock(lock); \ _raw_read_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _write_lock_irqsave(lock, flags) \ #define _write_lock_irqsave(lock, flags) \
...@@ -314,6 +326,7 @@ do { \ ...@@ -314,6 +326,7 @@ do { \
local_irq_save(flags); \ local_irq_save(flags); \
preempt_disable(); \ preempt_disable(); \
_raw_write_lock(lock); \ _raw_write_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _write_lock_irq(lock) \ #define _write_lock_irq(lock) \
...@@ -321,6 +334,7 @@ do { \ ...@@ -321,6 +334,7 @@ do { \
local_irq_disable(); \ local_irq_disable(); \
preempt_disable(); \ preempt_disable(); \
_raw_write_lock(lock); \ _raw_write_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _write_lock_bh(lock) \ #define _write_lock_bh(lock) \
...@@ -328,6 +342,7 @@ do { \ ...@@ -328,6 +342,7 @@ do { \
local_bh_disable(); \ local_bh_disable(); \
preempt_disable(); \ preempt_disable(); \
_raw_write_lock(lock); \ _raw_write_lock(lock); \
__acquire(lock); \
} while (0) } while (0)
#define _spin_unlock_irqrestore(lock, flags) \ #define _spin_unlock_irqrestore(lock, flags) \
...@@ -335,12 +350,7 @@ do { \ ...@@ -335,12 +350,7 @@ do { \
_raw_spin_unlock(lock); \ _raw_spin_unlock(lock); \
local_irq_restore(flags); \ local_irq_restore(flags); \
preempt_enable(); \ preempt_enable(); \
} while (0) __release(lock); \
#define _raw_spin_unlock_irqrestore(lock, flags) \
do { \
_raw_spin_unlock(lock); \
local_irq_restore(flags); \
} while (0) } while (0)
#define _spin_unlock_irq(lock) \ #define _spin_unlock_irq(lock) \
...@@ -348,6 +358,7 @@ do { \ ...@@ -348,6 +358,7 @@ do { \
_raw_spin_unlock(lock); \ _raw_spin_unlock(lock); \
local_irq_enable(); \ local_irq_enable(); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while (0) } while (0)
#define _spin_unlock_bh(lock) \ #define _spin_unlock_bh(lock) \
...@@ -355,6 +366,7 @@ do { \ ...@@ -355,6 +366,7 @@ do { \
_raw_spin_unlock(lock); \ _raw_spin_unlock(lock); \
preempt_enable(); \ preempt_enable(); \
local_bh_enable(); \ local_bh_enable(); \
__release(lock); \
} while (0) } while (0)
#define _write_unlock_bh(lock) \ #define _write_unlock_bh(lock) \
...@@ -362,6 +374,7 @@ do { \ ...@@ -362,6 +374,7 @@ do { \
_raw_write_unlock(lock); \ _raw_write_unlock(lock); \
preempt_enable(); \ preempt_enable(); \
local_bh_enable(); \ local_bh_enable(); \
__release(lock); \
} while (0) } while (0)
#define _read_unlock_irqrestore(lock, flags) \ #define _read_unlock_irqrestore(lock, flags) \
...@@ -369,6 +382,7 @@ do { \ ...@@ -369,6 +382,7 @@ do { \
_raw_read_unlock(lock); \ _raw_read_unlock(lock); \
local_irq_restore(flags); \ local_irq_restore(flags); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while (0) } while (0)
#define _write_unlock_irqrestore(lock, flags) \ #define _write_unlock_irqrestore(lock, flags) \
...@@ -376,6 +390,7 @@ do { \ ...@@ -376,6 +390,7 @@ do { \
_raw_write_unlock(lock); \ _raw_write_unlock(lock); \
local_irq_restore(flags); \ local_irq_restore(flags); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while (0) } while (0)
#define _read_unlock_irq(lock) \ #define _read_unlock_irq(lock) \
...@@ -383,6 +398,7 @@ do { \ ...@@ -383,6 +398,7 @@ do { \
_raw_read_unlock(lock); \ _raw_read_unlock(lock); \
local_irq_enable(); \ local_irq_enable(); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while (0) } while (0)
#define _read_unlock_bh(lock) \ #define _read_unlock_bh(lock) \
...@@ -390,6 +406,7 @@ do { \ ...@@ -390,6 +406,7 @@ do { \
_raw_read_unlock(lock); \ _raw_read_unlock(lock); \
local_bh_enable(); \ local_bh_enable(); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while (0) } while (0)
#define _write_unlock_irq(lock) \ #define _write_unlock_irq(lock) \
...@@ -397,6 +414,7 @@ do { \ ...@@ -397,6 +414,7 @@ do { \
_raw_write_unlock(lock); \ _raw_write_unlock(lock); \
local_irq_enable(); \ local_irq_enable(); \
preempt_enable(); \ preempt_enable(); \
__release(lock); \
} while (0) } while (0)
#endif /* !SMP */ #endif /* !SMP */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment