Message ID | 5253E583.5020805@asianux.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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@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@arm.com> Will
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@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@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.
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();
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@asianux.com> --- arch/arm/include/asm/atomic.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)