diff --git a/[refs] b/[refs] index 463796a6e56d..343d1dd1011b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d396c5f158547e50c2b78bc984cb4a72d76e969b +refs/heads/master: 14dadf1d5eb5bea2dd115852cfee880505c1c169 diff --git a/trunk/Documentation/spinlocks.txt b/trunk/Documentation/spinlocks.txt index 471e75389778..619699dde593 100644 --- a/trunk/Documentation/spinlocks.txt +++ b/trunk/Documentation/spinlocks.txt @@ -5,6 +5,28 @@ Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or __SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static initialization. +Most of the time, you can simply turn: + + static spinlock_t xxx_lock = SPIN_LOCK_UNLOCKED; + +into: + + static DEFINE_SPINLOCK(xxx_lock); + +Static structure member variables go from: + + struct foo bar { + .lock = SPIN_LOCK_UNLOCKED; + }; + +to: + + struct foo bar { + .lock = __SPIN_LOCK_UNLOCKED(bar.lock); + }; + +Declaration of static rw_locks undergo a similar transformation. + Dynamic initialization, when necessary, may be performed as demonstrated below.