]> git.baikalelectronics.ru Git - kernel.git/commit
LoongArch: Mark __xchg() and __cmpxchg() as __always_inline
authorHuacai Chen <chenhuacai@loongson.cn>
Wed, 12 Oct 2022 08:36:08 +0000 (16:36 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 12 Oct 2022 08:36:08 +0000 (16:36 +0800)
commitbb9dd548f2d091cf1a158a5e95bcb6c4cd43335a
tree930d40686b776b56380e3d1eee962930527ca62e
parent79a345bca1a3614df1a37928408615bd9356d0e0
LoongArch: Mark __xchg() and __cmpxchg() as __always_inline

Commit 7a0f539ed93c ("compiler: enable CONFIG_OPTIMIZE_INLINING
forcibly") allows compiler to uninline functions marked as 'inline'.
In case of __xchg()/__cmpxchg() this would cause to reference
BUILD_BUG(), which is an error case for catching bugs and will not
happen for correct code, if __xchg()/__cmpxchg() is inlined.

This bug can be produced with CONFIG_DEBUG_SECTION_MISMATCH enabled,
and the solution is similar to below commits:
9b099fb39942956 ("MIPS: include: Mark __xchg as __always_inline"),
83f6e6eea06282e ("MIPS: include: Mark __cmpxchg as __always_inline").

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/cmpxchg.h