Re: [PATCH] ARC: atomic64: fix atomic64_add_unless function

2018-08-14 Thread Eugeniy Paltsev
On Tue, 2018-08-14 at 13:42 +, Vineet Gupta wrote: > On 08/11/2018 09:09 AM, Eugeniy Paltsev wrote: > > Current implementation of 'atomic64_add_unless' function > > (and hence 'atomic64_inc_not_zero') return incorrect value > > if lover 32 bits of compared 64-bit number are equal and > >

Re: [PATCH] ARC: atomic64: fix atomic64_add_unless function

2018-08-14 Thread Vineet Gupta
On 08/11/2018 09:09 AM, Eugeniy Paltsev wrote: > Current implementation of 'atomic64_add_unless' function > (and hence 'atomic64_inc_not_zero') return incorrect value > if lover 32 bits of compared 64-bit number are equal and > higher 32 bits aren't. > > For in following example

[PATCH] ARC: atomic64: fix atomic64_add_unless function

2018-08-11 Thread Eugeniy Paltsev
Current implementation of 'atomic64_add_unless' function (and hence 'atomic64_inc_not_zero') return incorrect value if lover 32 bits of compared 64-bit number are equal and higher 32 bits aren't. For in following example atomic64_add_unless must return '1' but it actually returns '0':