Re: [PATCH] include/asm-generic/cmpxchg-local.h: perform comparison in cmpxchg using appropriate size of data

2014-08-26 Thread Darius Rad
On 08/26/2014 08:33 AM, Arnd Bergmann wrote: > On Monday 25 August 2014 11:33:07 Darius Rad wrote: >> In the generic implementation of cmpxchg, cast the parameters to the size >> of the data prior to comparison. Otherwise, it is possible for the >> comparison to be done incorrectly in the case whe

Re: [PATCH] include/asm-generic/cmpxchg-local.h: perform comparison in cmpxchg using appropriate size of data

2014-08-26 Thread Arnd Bergmann
On Monday 25 August 2014 11:33:07 Darius Rad wrote: > In the generic implementation of cmpxchg, cast the parameters to the size > of the data prior to comparison. Otherwise, it is possible for the > comparison to be done incorrectly in the case where the data size is > smaller than the architectur

[PATCH] include/asm-generic/cmpxchg-local.h: perform comparison in cmpxchg using appropriate size of data

2014-08-25 Thread Darius Rad
In the generic implementation of cmpxchg, cast the parameters to the size of the data prior to comparison. Otherwise, it is possible for the comparison to be done incorrectly in the case where the data size is smaller than the architecture register size. For example, on a 64-bit architecture, a 3