ARC: make futex_atomic_cmpxchg_inatomic() return bimodal
authorVineet Gupta <vgupta@synopsys.com>
Thu, 6 Aug 2015 11:33:17 +0000 (17:03 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Thu, 20 Aug 2015 12:46:00 +0000 (18:16 +0530)
commit882a95ae0a4f8fc303257acf5c6ff305df34d04b
tree2de6c5e17b3a7e0b5e06afe4246b81ef27e521b7
parented574e2bbd81ec20134059fb5e17acbc76387270
ARC: make futex_atomic_cmpxchg_inatomic() return bimodal

Callers of cmpxchg_futex_value_locked() in futex code expect bimodal
return value:
  !0 (essentially -EFAULT as failure)
   0 (success)

Before this patch, the success return value was old value of futex,
which could very well be non zero, causing caller to possibly take the
failure path erroneously.

Fix that by returning 0 for success

(This fix was done back in 2011 for all upstream arches, which ARC
obviously missed)

Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/futex.h