Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

asm-generic: Fix 32 bit __generic_cmpxchg_local

Commit 656e9007ef58 ("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: 656e9007ef58 ("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>

authored by

David McKay and committed by
Arnd Bergmann
d93cca2f d6e81532

+1 -1
+1 -1
include/asm-generic/cmpxchg-local.h
··· 34 34 *(u16 *)ptr = (new & 0xffffu); 35 35 break; 36 36 case 4: prev = *(u32 *)ptr; 37 - if (prev == (old & 0xffffffffffu)) 37 + if (prev == (old & 0xffffffffu)) 38 38 *(u32 *)ptr = (new & 0xffffffffu); 39 39 break; 40 40 case 8: prev = *(u64 *)ptr;