aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/include/asm/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/include/asm/mutex.h')
-rw-r--r--arch/ia64/include/asm/mutex.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/ia64/include/asm/mutex.h b/arch/ia64/include/asm/mutex.h
index bed73a643a56..f41e66d65e31 100644
--- a/arch/ia64/include/asm/mutex.h
+++ b/arch/ia64/include/asm/mutex.h
@@ -29,17 +29,15 @@ __mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
29 * __mutex_fastpath_lock_retval - try to take the lock by moving the count 29 * __mutex_fastpath_lock_retval - try to take the lock by moving the count
30 * from 1 to a 0 value 30 * from 1 to a 0 value
31 * @count: pointer of type atomic_t 31 * @count: pointer of type atomic_t
32 * @fail_fn: function to call if the original value was not 1
33 * 32 *
34 * Change the count from 1 to a value lower than 1, and call <fail_fn> if 33 * Change the count from 1 to a value lower than 1. This function returns 0
35 * it wasn't 1 originally. This function returns 0 if the fastpath succeeds, 34 * if the fastpath succeeds, or -1 otherwise.
36 * or anything the slow path function returns.
37 */ 35 */
38static inline int 36static inline int
39__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) 37__mutex_fastpath_lock_retval(atomic_t *count)
40{ 38{
41 if (unlikely(ia64_fetchadd4_acq(count, -1) != 1)) 39 if (unlikely(ia64_fetchadd4_acq(count, -1) != 1))
42 return fail_fn(count); 40 return -1;
43 return 0; 41 return 0;
44} 42}
45 43