Skip to content

Commit 1acf93c

Browse files
committed
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking build fix from Thomas Gleixner: "A single fix for a build fail with CONFIG_PROFILE_ALL_BRANCHES=y in the qspinlock code" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/qspinlock: Fix compile error
2 parents 0b002cd + b987ffc commit 1acf93c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

arch/x86/include/asm/qspinlock.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
#define queued_fetch_set_pending_acquire queued_fetch_set_pending_acquire
1414
static __always_inline u32 queued_fetch_set_pending_acquire(struct qspinlock *lock)
1515
{
16-
u32 val = 0;
17-
18-
if (GEN_BINARY_RMWcc(LOCK_PREFIX "btsl", lock->val.counter, c,
19-
"I", _Q_PENDING_OFFSET))
20-
val |= _Q_PENDING_VAL;
16+
u32 val;
2117

18+
/*
19+
* We can't use GEN_BINARY_RMWcc() inside an if() stmt because asm goto
20+
* and CONFIG_PROFILE_ALL_BRANCHES=y results in a label inside a
21+
* statement expression, which GCC doesn't like.
22+
*/
23+
val = GEN_BINARY_RMWcc(LOCK_PREFIX "btsl", lock->val.counter, c,
24+
"I", _Q_PENDING_OFFSET) * _Q_PENDING_VAL;
2225
val |= atomic_read(&lock->val) & ~_Q_PENDING_MASK;
2326

2427
return val;

0 commit comments

Comments
 (0)