Skip to content

Commit d93cca2

Browse files
djmsiparndb
authored andcommitted
asm-generic: Fix 32 bit __generic_cmpxchg_local
Commit 656e900 ("asm-generic: avoid __generic_cmpxchg_local warnings") introduced a typo that means the code is incorrect for 32 bit values. It will work fine for postive numbers, but will fail for negative numbers on a system where longs are 64 bit. Fixes: 656e900 ("asm-generic: avoid __generic_cmpxchg_local warnings") Signed-off-by: David McKay <david.mckay@codasip.com> Signed-off-by: Stuart Menefy <stuart.menefy@codasip.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent d6e8153 commit d93cca2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/asm-generic/cmpxchg-local.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static inline unsigned long __generic_cmpxchg_local(volatile void *ptr,
3434
*(u16 *)ptr = (new & 0xffffu);
3535
break;
3636
case 4: prev = *(u32 *)ptr;
37-
if (prev == (old & 0xffffffffffu))
37+
if (prev == (old & 0xffffffffu))
3838
*(u32 *)ptr = (new & 0xffffffffu);
3939
break;
4040
case 8: prev = *(u64 *)ptr;

0 commit comments

Comments
 (0)