Leading comma prevents arbitrary reordering of initialisation clauses. The whole point of C99 initialisation is to allow any such reordering.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -60,39 +60,39 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) · 59 unmodified lines | ||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | #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 | 65 | /* Common initializer macros and functions */ |
| 66 | 66 | |
| 67 | 67 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 68 | 68 | # define __RWSEM_DEP_MAP_INIT(lockname) \ |
| 69 | − , .dep_map = { \ | |
| 69 | + .dep_map = { \ | |
| 70 | 70 | .name = #lockname, \ |
| 71 | 71 | .wait_type_inner = LD_WAIT_SLEEP, \ |
| 72 | − } | |
| 72 | + }, | |
| 73 | 73 | #else |
| 74 | 74 | # define __RWSEM_DEP_MAP_INIT(lockname) |
| 75 | 75 | #endif |
| 76 | 76 | |
| 77 | 77 | #ifdef CONFIG_DEBUG_RWSEMS |
| 78 | −# define __DEBUG_RWSEM_INITIALIZER(lockname) , .magic = &lockname | |
| 78 | +# define __RWSEM_DEBUG_INIT(lockname) .magic = &lockname, | |
| 79 | 79 | #else |
| 80 | −# define __DEBUG_RWSEM_INITIALIZER(lockname) | |
| 80 | +# define __RWSEM_DEBUG_INIT(lockname) | |
| 81 | 81 | #endif |
| 82 | 82 | |
| 83 | 83 | #ifdef CONFIG_RWSEM_SPIN_ON_OWNER |
| 84 | −#define __RWSEM_OPT_INIT(lockname) , .osq = OSQ_LOCK_UNLOCKED | |
| 84 | +#define __RWSEM_OPT_INIT(lockname) .osq = OSQ_LOCK_UNLOCKED, | |
| 85 | 85 | #else |
| 86 | 86 | #define __RWSEM_OPT_INIT(lockname) |
| 87 | 87 | #endif |
| 88 | 88 | |
| 89 | 89 | #define __RWSEM_INITIALIZER(name) \ |
| 90 | − { __RWSEM_INIT_COUNT(name), \ | |
| 90 | + { __RWSEM_COUNT_INIT(name), \ | |
| 91 | 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 | 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 | 96 | __RWSEM_DEP_MAP_INIT(name) } |
| 97 | 97 | |
| 98 | 98 | #define DECLARE_RWSEM(name) \ |