From 940eeca6f58be5e253e62144feb9bec26090d7a9 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Mon, 4 Mar 2019 13:51:09 +0900 Subject: [PATCH] x86 spinlock trylock: make next initializer old-gcc friendly old gcc versions are stupid with nested structs and need us to initialize .tickets.head and .tickets.tail in one go Change-Id: I0d4caf8236066e7edf4a12e3270114132ced9585 --- arch/x86_64/kernel/include/arch-lock.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86_64/kernel/include/arch-lock.h b/arch/x86_64/kernel/include/arch-lock.h index 140052b3..e464fa19 100644 --- a/arch/x86_64/kernel/include/arch-lock.h +++ b/arch/x86_64/kernel/include/arch-lock.h @@ -53,7 +53,10 @@ rc = __ihk_mc_spinlock_trylock_noirq(l); \ static inline int __ihk_mc_spinlock_trylock_noirq(ihk_spinlock_t *lock) { ihk_spinlock_t cur = { .head_tail = lock->head_tail }; - ihk_spinlock_t next = { .tickets.head = cur.tickets.head, .tickets.tail = cur.tickets.tail + 2 }; + ihk_spinlock_t next = { .tickets = { + .head = cur.tickets.head, + .tail = cur.tickets.tail + 2 + } }; int success; if (cur.tickets.head != cur.tickets.tail) {