From: Davidlohr Bueso Date: Tue, 20 May 2014 00:27:57 +0000 (-0700) Subject: locking/rwsem: Fix warnings for CONFIG_RWSEM_GENERIC_SPINLOCK X-Git-Tag: v3.16-rc1~26^2~4 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=dbb5eafa23fdb7a00d64b04e23a3efc59d6474cb;p=linux.git locking/rwsem: Fix warnings for CONFIG_RWSEM_GENERIC_SPINLOCK Optimistic spinning is only used by the xadd variant of rw-semaphores. Make sure that we use the old version of the __RWSEM_INITIALIZER macro for systems that rely on the spinlock one, otherwise warnings can be triggered, such as the following reported on an arm box: ipc/ipcns_notifier.c:22:8: warning: excess elements in struct initializer [enabled by default] ipc/ipcns_notifier.c:22:8: warning: (near initialization for 'ipcns_chain.rwsem') [enabled by default] ipc/ipcns_notifier.c:22:8: warning: excess elements in struct initializer [enabled by default] ipc/ipcns_notifier.c:22:8: warning: (near initialization for 'ipcns_chain.rwsem') [enabled by default] Signed-off-by: Davidlohr Bueso Signed-off-by: Peter Zijlstra Cc: Tim Chen Cc: Linus Torvalds Cc: Paul McKenney Cc: Michel Lespinasse Cc: Peter Hurley Cc: Alex Shi Cc: Rik van Riel Cc: Andrew Morton Cc: Andrea Arcangeli Cc: "H. Peter Anvin" Cc: Jason Low Cc: Andi Kleen Cc: Chris Mason Cc: Josef Bacik Link: http://lkml.kernel.org/r/1400545677.6399.10.camel@buesod1.americas.hpqcorp.net Signed-off-by: Ingo Molnar --- diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 3e108f154cb6..8d79708146aa 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h @@ -64,7 +64,7 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) # define __RWSEM_DEP_MAP_INIT(lockname) #endif -#ifdef CONFIG_SMP +#if defined(CONFIG_SMP) && !defined(CONFIG_RWSEM_GENERIC_SPINLOCK) #define __RWSEM_INITIALIZER(name) \ { RWSEM_UNLOCKED_VALUE, \ __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \