From 519fa60b6007fe19a32c5a50541dd7b38bd11b37 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 21 Jan 2020 14:15:29 +0100 Subject: microblaze: Use asm generic cmpxchg.h for !SMP case The whole implementation is done in asm-generic/cmpxchg.h file and there is no reason to duplicate it. Also do not include asm-generic/cmpxchg-local.h because it is already included from asm-generic/cmpxchg.h Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall Reviewed-by: Arnd Bergmann --- arch/microblaze/include/asm/cmpxchg.h | 40 +++-------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'arch/microblaze/include/asm') diff --git a/arch/microblaze/include/asm/cmpxchg.h b/arch/microblaze/include/asm/cmpxchg.h index 596300c74509..3523b51aab36 100644 --- a/arch/microblaze/include/asm/cmpxchg.h +++ b/arch/microblaze/include/asm/cmpxchg.h @@ -2,42 +2,8 @@ #ifndef _ASM_MICROBLAZE_CMPXCHG_H #define _ASM_MICROBLAZE_CMPXCHG_H -#include - -void __bad_xchg(volatile void *ptr, int size); - -static inline unsigned long __xchg(unsigned long x, volatile void *ptr, - int size) -{ - unsigned long ret; - unsigned long flags; - - switch (size) { - case 1: - local_irq_save(flags); - ret = *(volatile unsigned char *)ptr; - *(volatile unsigned char *)ptr = x; - local_irq_restore(flags); - break; - - case 4: - local_irq_save(flags); - ret = *(volatile unsigned long *)ptr; - *(volatile unsigned long *)ptr = x; - local_irq_restore(flags); - break; - default: - __bad_xchg(ptr, size), ret = 0; - break; - } - - return ret; -} - -#define xchg(ptr, x) \ - ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) - -#include -#include +#ifndef CONFIG_SMP +# include +#endif #endif /* _ASM_MICROBLAZE_CMPXCHG_H */ -- cgit v1.2.3