lkml.org 
[lkml]   [2015]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.12 108/155] ARM: 7867/1: include: asm: use 'int' instead of 'unsigned long' for 'oldval' in atomic_cmpxchg().
    Date
    From: Chen Gang <gang.chen@asianux.com>

    3.12-stable review patch. If anyone has any objections, please let me know.

    ===============

    commit 4dcc1cf7316a26e112f5c9fcca531ff98ef44700 upstream.

    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).

    Reviewed-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Chen Gang <gang.chen@asianux.com>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    ---
    arch/arm/include/asm/atomic.h | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
    index a715ac049e4c..9ee7e01066f9 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();

    --
    2.3.4


    \
     
     \ /
      Last update: 2015-04-07 15:01    [W:2.224 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site