Skip to content

Commit 63f1ee2

Browse files
mhiramatglaubitz
authored andcommitted
locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local()
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>
1 parent 78a96c8 commit 63f1ee2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/sh/include/asm/cmpxchg.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,13 @@ static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old,
7171
(unsigned long)_n_, sizeof(*(ptr))); \
7272
})
7373

74+
#include <asm-generic/cmpxchg-local.h>
75+
76+
#define arch_cmpxchg_local(ptr, o, n) ({ \
77+
(__typeof__(*ptr))__generic_cmpxchg_local((ptr), \
78+
(unsigned long)(o), \
79+
(unsigned long)(n), \
80+
sizeof(*(ptr))); \
81+
})
82+
7483
#endif /* __ASM_SH_CMPXCHG_H */

0 commit comments

Comments
 (0)