locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local()
authorMasami Hiramatsu <mhiramat@kernel.org>
Wed, 25 Oct 2023 15:10:05 +0000 (00:10 +0900)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 2 Nov 2023 09:13:12 +0000 (10:13 +0100)
Use __generic_cmpxchg_local() for arch_cmpxchg_local() implementation
on SH architecture because it does not implement arch_cmpxchg_local().

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310241310.Ir5uukOG-lkp@intel.com/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/169824660459.24340.14614817132696360531.stgit@devnote2
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
arch/sh/include/asm/cmpxchg.h

index 288f6f38d98fb4142e4646b78f8bf82387a34ccf..5d617b3ef78f77b86c20d9aaedc553991c911f1a 100644 (file)
@@ -71,4 +71,13 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
                                    (unsigned long)_n_, sizeof(*(ptr))); \
   })
 
+#include <asm-generic/cmpxchg-local.h>
+
+#define arch_cmpxchg_local(ptr, o, n) ({                               \
+       (__typeof__(*ptr))__generic_cmpxchg_local((ptr),                \
+                                                 (unsigned long)(o),   \
+                                                 (unsigned long)(n),   \
+                                                 sizeof(*(ptr)));      \
+})
+
 #endif /* __ASM_SH_CMPXCHG_H */