[PATCH v2 2/2] ARM: include: asm: use 'int' instead of 'unsigned long' for 'oldval' in atomic_cmpxchg().

Chen Gang gang.chen at asianux.com
Wed Oct 9 20:56:03 EDT 2013


On 10/09/2013 06:48 PM, Will Deacon wrote:
> On Tue, Oct 08, 2013 at 11:59:15AM +0100, Chen Gang wrote:
>> For atomic_cmpxchg(), the type of 'oldval' need be 'int' to match the
>> type of "*ptr" (used by 'ldrex' instruction) and 'old' (used by 'teq'
>> instruction).
>>
>> Signed-off-by: Chen Gang <gang.chen at asianux.com>
>> ---
>>  arch/arm/include/asm/atomic.h |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
>> index a715ac0..9ee7e01 100644
>> --- a/arch/arm/include/asm/atomic.h
>> +++ b/arch/arm/include/asm/atomic.h
>> @@ -114,7 +114,8 @@ static inline int atomic_sub_return(int i, atomic_t *v)
>>  
>>  static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
>>  {
>> -	unsigned long oldval, res;
>> +	int oldval;
>> +	unsigned long res;
>>  
>>  	smp_mb();
> 
> As discussed, this is completely cosmetic, but does at least keep the file
> consistent.
> 
>   Reviewed-by: Will Deacon <will.deacon at arm.com>
> 

Hmm... it seems better to let you as "Signed-of-by" too, for this is
mainly found by you. :-)

And I feel, these kinds of files are the dresses of 'arm32/64' (just
like "asm-generic/*" are the dresses of 'arch'), so not only consider
about whether useful, but also need consider about whether clean.

> Will
> 
> 

Thanks.
-- 
Chen Gang



More information about the linux-arm-kernel mailing list