[PATCH] Lock initializer cleanup (common headers)
First part of the patch series. Define initializer macros Often used structures in the kernel are almost all declared and initialized by macros in the form: DEFINE_TYPE(name) Spinlocks and rwlocks are declared and initialized by: type name = INITIALIZER; After converting the runtime initialization of spinlocks/rwlocks to macro form it is consequent to change the declaration and initializion of global and static locks to the macro form too. This conversion identifies those variables as "special", common code controlled entities similar to list_heads, mutexes... Besides consistency and code clearness this also helps automatic lock validators and debugging code. The patch converts -rwlock_t snd_card_rwlock = RW_LOCK_UNLOCKED; +DEFINE_RWLOCK(snd_card_rwlock); and -static spinlock_t slave_active_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(slave_active_lock); There is no runtime overhead or actual code change resulting out of this patch, other than a small reduction in the kernel source code size. 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. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment