Skip to content

Commit

Permalink
locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masami Hiramatsu authored and John Paul Adrian Glaubitz committed Nov 2, 2023
1 parent 78a96c8 commit 63f1ee2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/sh/include/asm/cmpxchg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 63f1ee2

Please sign in to comment.