Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: include: Mark __xchg as __always_inline

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

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

authored by

Thomas Bogendoerfer and committed by
Paul Burton
46f16195 88356d09

+2 -2
+2 -2
arch/mips/include/asm/cmpxchg.h
··· 77 77 extern unsigned long __xchg_small(volatile void *ptr, unsigned long val, 78 78 unsigned int size); 79 79 80 - static inline unsigned long __xchg(volatile void *ptr, unsigned long x, 81 - int size) 80 + static __always_inline 81 + unsigned long __xchg(volatile void *ptr, unsigned long x, int size) 82 82 { 83 83 switch (size) { 84 84 case 1: