History

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]

Davidlohr Bueso committed 12 years ago

Commit dbb5eaf1 parent 4fc828e1 file · +1 −1Browse files

Unified · Split

include/linux/rwsem.h+1−1
@@ -64,7 +64,7 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) · 63 unmodified lines
64# define __RWSEM_DEP_MAP_INIT(lockname)64# define __RWSEM_DEP_MAP_INIT(lockname)
65#endif65#endif
66 66
67#ifdef CONFIG_SMP67#if defined(CONFIG_SMP) && !defined(CONFIG_RWSEM_GENERIC_SPINLOCK)
68#define __RWSEM_INITIALIZER(name) \68#define __RWSEM_INITIALIZER(name) \
69 { RWSEM_UNLOCKED_VALUE, \69 { RWSEM_UNLOCKED_VALUE, \
70 __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \70 __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \