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

Fix m32r __xchg

the #endif /* CONFIG_SMP */ should cover the default condition, or it may cause
bad parameter to be silently missed.

To make it work correctly, we have to remove the ifdef CONFIG SMP surrounding
__xchg_called_with_bad_pointer declaration. Thanks to Adrian Bunk for detecting
this.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Acked-by: Hirokazu Takata <takata@linux-m32r.org>
Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mathieu Desnoyers and committed by
Linus Torvalds
f94d1d3a 7b631c2d

+1 -3
+1 -3
include/asm-m32r/system.h
··· 127 127 ((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr), \ 128 128 sizeof(*(ptr)))) 129 129 130 - #ifdef CONFIG_SMP 131 130 extern void __xchg_called_with_bad_pointer(void); 132 - #endif 133 131 134 132 #ifdef CONFIG_CHIP_M32700_TS1 135 133 #define DCACHE_CLEAR(reg0, reg1, addr) \ ··· 187 189 #endif /* CONFIG_CHIP_M32700_TS1 */ 188 190 ); 189 191 break; 192 + #endif /* CONFIG_SMP */ 190 193 default: 191 194 __xchg_called_with_bad_pointer(); 192 - #endif /* CONFIG_SMP */ 193 195 } 194 196 195 197 local_irq_restore(flags);