diff options
Diffstat (limited to 'include/asm-generic/cmpxchg-local.h')
-rw-r--r-- | include/asm-generic/cmpxchg-local.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h index 380cdc824e4b..c3e7315b7c1d 100644 --- a/include/asm-generic/cmpxchg-local.h +++ b/include/asm-generic/cmpxchg-local.h @@ -26,15 +26,15 @@ static inline unsigned long __generic_cmpxchg_local(volatile void *ptr, raw_local_irq_save(flags); switch (size) { case 1: prev = *(u8 *)ptr; - if (prev == old) + if (prev == (u8)old) *(u8 *)ptr = (u8)new; break; case 2: prev = *(u16 *)ptr; - if (prev == old) + if (prev == (u16)old) *(u16 *)ptr = (u16)new; break; case 4: prev = *(u32 *)ptr; - if (prev == old) + if (prev == (u32)old) *(u32 *)ptr = (u32)new; break; case 8: prev = *(u64 *)ptr; |