aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/asm-generic
diff options
context:
space:
mode:
authorDavid McKay <david.mckay@codasip.com>2024-01-04 09:40:10 +0000
committerArnd Bergmann <arnd@arndb.de>2024-01-05 23:19:14 +0100
commitd93cca2f3109f88c94a32d3322ec8b2854a9c339 (patch)
tree1b00871dbfab6e39c9aa8bef5bdf52e6ff46e9aa /include/asm-generic
parentHexagon: Make pfn accessors statics inlines (diff)
downloadwireguard-linux-d93cca2f3109f88c94a32d3322ec8b2854a9c339.tar.xz
wireguard-linux-d93cca2f3109f88c94a32d3322ec8b2854a9c339.zip
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>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/cmpxchg-local.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h
index 3df9f59a544e..f27d66fdc00a 100644
--- a/include/asm-generic/cmpxchg-local.h
+++ b/include/asm-generic/cmpxchg-local.h
@@ -34,7 +34,7 @@ static inline unsigned long __generic_cmpxchg_local(volatile void *ptr,
*(u16 *)ptr = (new & 0xffffu);
break;
case 4: prev = *(u32 *)ptr;
- if (prev == (old & 0xffffffffffu))
+ if (prev == (old & 0xffffffffu))
*(u32 *)ptr = (new & 0xffffffffu);
break;
case 8: prev = *(u64 *)ptr;