Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[IA64] fix bug in ia64 __mutex_fastpath_trylock

The parenthesis around "likely" used in ia64 __mutex_fastpath_trylock
is incorrect, and it leads to broken mutex_trylock. Here is the
patch that fixed the bug. I removed the likely altogether because
there is no branch and gcc does a reasonable job at predicating the
return value.

Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by

Chen, Kenneth W and committed by
Tony Luck
cfab9d0e 06812266

+1 -1
+1 -1
include/asm-ia64/mutex.h
··· 84 84 static inline int 85 85 __mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *)) 86 86 { 87 - if (likely(cmpxchg_acq(count, 1, 0)) == 1) 87 + if (cmpxchg_acq(count, 1, 0) == 1) 88 88 return 1; 89 89 return 0; 90 90 }