From: To make spinlock/rwlock initialization consistent all over the kernel, this patch converts explicit lock-initializers into spin_lock_init() and rwlock_init() calls. Currently, spinlocks and rwlocks are initialized in two different ways: lock = SPIN_LOCK_UNLOCKED spin_lock_init(&lock) rwlock = RW_LOCK_UNLOCKED rwlock_init(&rwlock) this patch converts all explicit lock initializations to spin_lock_init() or rwlock_init(). (Besides consistency this also helps automatic lock validators and debugging code.) The conversion was done with a script, it was verified manually and it was reviewed, compiled and tested as far as possible on x86, ARM, PPC. There is no runtime overhead or actual code change resulting out of this patch, because spin_lock_init() and rwlock_init() are macros and are thus equivalent to the explicit initialization method. That's the second batch of the unifying patches. Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Signed-off-by: Andrew Morton --- /dev/null | 0 25-akpm/drivers/char/drm/gamma_lists.h | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff -L drivers/char/drm/drm_drv.h -puN /dev/null /dev/null diff -puN drivers/char/drm/gamma_lists.h~lock-initializer-unifying-batch-2-drm drivers/char/drm/gamma_lists.h --- 25/drivers/char/drm/gamma_lists.h~lock-initializer-unifying-batch-2-drm 2004-11-03 13:51:50.396914848 -0800 +++ 25-akpm/drivers/char/drm/gamma_lists.h 2004-11-03 13:51:54.660266720 -0800 @@ -45,8 +45,8 @@ int DRM(waitlist_create)(drm_waitlist_t bl->rp = bl->bufs; bl->wp = bl->bufs; bl->end = &bl->bufs[bl->count+1]; - bl->write_lock = SPIN_LOCK_UNLOCKED; - bl->read_lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&bl->write_lock); + spin_lock_init(&bl->read_lock); return 0; } @@ -110,7 +110,7 @@ int DRM(freelist_create)(drm_freelist_t bl->low_mark = 0; bl->high_mark = 0; atomic_set(&bl->wfh, 0); - bl->lock = SPIN_LOCK_UNLOCKED; + spin_lock_init(&bl->lock); ++bl->initialized; return 0; } _