diff options
Diffstat (limited to 'arch/openrisc/include/asm/cmpxchg.h')
-rw-r--r-- | arch/openrisc/include/asm/cmpxchg.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/openrisc/include/asm/cmpxchg.h b/arch/openrisc/include/asm/cmpxchg.h index 5fcb9ac72693..f0a5d8b844d6 100644 --- a/arch/openrisc/include/asm/cmpxchg.h +++ b/arch/openrisc/include/asm/cmpxchg.h | |||
@@ -77,7 +77,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr, | |||
77 | return val; | 77 | return val; |
78 | } | 78 | } |
79 | 79 | ||
80 | #define xchg(ptr, with) \ | 80 | #define xchg(ptr, with) \ |
81 | ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr)))) | 81 | ({ \ |
82 | (__typeof__(*(ptr))) __xchg((unsigned long)(with), \ | ||
83 | (ptr), \ | ||
84 | sizeof(*(ptr))); \ | ||
85 | }) | ||
82 | 86 | ||
83 | #endif /* __ASM_OPENRISC_CMPXCHG_H */ | 87 | #endif /* __ASM_OPENRISC_CMPXCHG_H */ |