]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
x86-32: Fix atomic64_inc_not_zero return value convention
authorLuca Barbieri <luca@luca-barbieri.com>
Mon, 1 Mar 2010 18:55:49 +0000 (19:55 +0100)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 1 Mar 2010 19:39:03 +0000 (11:39 -0800)
atomic64_inc_not_zero must return 1 if it perfomed the add and 0 otherwise.
It was doing the opposite thing.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
LKML-Reference: <1267469749-11878-6-git-send-email-luca@luca-barbieri.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/lib/atomic64_386_32.S
arch/x86/lib/atomic64_cx8_32.S

index a2f847c88b89dc4cb37f281bd712fc4e81bb3f9c..4a5979aa6883addce8921161b68bc9d8b7206ffc 100644 (file)
@@ -153,13 +153,12 @@ BEGIN inc_not_zero %esi
        adcl $0, %edx
        movl %eax,  ($v)
        movl %edx, 4($v)
-       xorl %eax, %eax
+       movl $1, %eax
 2:
 RETURN
 3:
        testl %edx, %edx
        jne 1b
-       movl $1, %eax
        jmp 2b
 END_
 
index d0e37b189f828fe0bc04f3c1d27142c2a55f9cbf..71e080de3352471fca97c2b29816cddcbb746524 100644 (file)
@@ -212,14 +212,13 @@ ENTRY(atomic64_inc_not_zero_cx8)
        cmpxchg8b (%esi)
        jne 1b
 
-       xorl %eax, %eax
+       movl $1, %eax
 3:
        RESTORE ebx
        ret
 4:
        testl %edx, %edx
        jne 2b
-       movl $1, %eax
        jmp 3b
        CFI_ENDPROC
 ENDPROC(atomic64_inc_not_zero_cx8)