History

rwsem: fix commas in initialisation

Leading comma prevents arbitrary reordering of initialisation clauses. The whole point of C99 initialisation is to allow any such reordering.

Alexey Dobriyan committed 6 years ago

Commit a9232dc1 parent 482cbb61 file · +10 −10Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/rwsem.h+10−10
@@ -60,39 +60,39 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) · 59 unmodified lines
60}60}
61 61
62#define RWSEM_UNLOCKED_VALUE 0L62#define RWSEM_UNLOCKED_VALUE 0L
63#define __RWSEM_INIT_COUNT(name) .count = ATOMIC_LONG_INIT(RWSEM_UNLOCKED_VALUE)63#define __RWSEM_COUNT_INIT(name) .count = ATOMIC_LONG_INIT(RWSEM_UNLOCKED_VALUE)
64 64
65/* Common initializer macros and functions */65/* Common initializer macros and functions */
66 66
67#ifdef CONFIG_DEBUG_LOCK_ALLOC67#ifdef CONFIG_DEBUG_LOCK_ALLOC
68# define __RWSEM_DEP_MAP_INIT(lockname) \68# define __RWSEM_DEP_MAP_INIT(lockname) \
69 , .dep_map = { \69 .dep_map = { \
70 .name = #lockname, \70 .name = #lockname, \
71 .wait_type_inner = LD_WAIT_SLEEP, \71 .wait_type_inner = LD_WAIT_SLEEP, \
72 }72 },
73#else73#else
74# define __RWSEM_DEP_MAP_INIT(lockname)74# define __RWSEM_DEP_MAP_INIT(lockname)
75#endif75#endif
76 76
77#ifdef CONFIG_DEBUG_RWSEMS77#ifdef CONFIG_DEBUG_RWSEMS
78# define __DEBUG_RWSEM_INITIALIZER(lockname) , .magic = &lockname78# define __RWSEM_DEBUG_INIT(lockname) .magic = &lockname,
79#else79#else
80# define __DEBUG_RWSEM_INITIALIZER(lockname)80# define __RWSEM_DEBUG_INIT(lockname)
81#endif81#endif
82 82
83#ifdef CONFIG_RWSEM_SPIN_ON_OWNER83#ifdef CONFIG_RWSEM_SPIN_ON_OWNER
84#define __RWSEM_OPT_INIT(lockname) , .osq = OSQ_LOCK_UNLOCKED84#define __RWSEM_OPT_INIT(lockname) .osq = OSQ_LOCK_UNLOCKED,
85#else85#else
86#define __RWSEM_OPT_INIT(lockname)86#define __RWSEM_OPT_INIT(lockname)
87#endif87#endif
88 88
89#define __RWSEM_INITIALIZER(name) \89#define __RWSEM_INITIALIZER(name) \
90 { __RWSEM_INIT_COUNT(name), \90 { __RWSEM_COUNT_INIT(name), \
91 .owner = ATOMIC_LONG_INIT(0), \91 .owner = ATOMIC_LONG_INIT(0), \
92 .wait_list = LIST_HEAD_INIT((name).wait_list), \
93 .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock) \
94 __RWSEM_OPT_INIT(name) \92 __RWSEM_OPT_INIT(name) \
95 __DEBUG_RWSEM_INITIALIZER(name) \93 .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock),\
94 .wait_list = LIST_HEAD_INIT((name).wait_list), \
95 __RWSEM_DEBUG_INIT(name) \
96 __RWSEM_DEP_MAP_INIT(name) }96 __RWSEM_DEP_MAP_INIT(name) }
97 97
98#define DECLARE_RWSEM(name) \98#define DECLARE_RWSEM(name) \