Browse Source

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>
Mathieu Desnoyers 17 years ago
parent
commit
f94d1d3a1d
1 changed files with 1 additions and 3 deletions
  1. 1 3
      include/asm-m32r/system.h

+ 1 - 3
include/asm-m32r/system.h

@@ -127,9 +127,7 @@ static inline void local_irq_disable(void)
 	((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr),	\
 	((__typeof__(*(ptr)))__xchg_local((unsigned long)(x), (ptr),	\
 			sizeof(*(ptr))))
 			sizeof(*(ptr))))
 
 
-#ifdef CONFIG_SMP
 extern void  __xchg_called_with_bad_pointer(void);
 extern void  __xchg_called_with_bad_pointer(void);
-#endif
 
 
 #ifdef CONFIG_CHIP_M32700_TS1
 #ifdef CONFIG_CHIP_M32700_TS1
 #define DCACHE_CLEAR(reg0, reg1, addr)				\
 #define DCACHE_CLEAR(reg0, reg1, addr)				\
@@ -189,9 +187,9 @@ __xchg(unsigned long x, volatile void *ptr, int size)
 #endif	/* CONFIG_CHIP_M32700_TS1 */
 #endif	/* CONFIG_CHIP_M32700_TS1 */
 		);
 		);
 		break;
 		break;
+#endif  /* CONFIG_SMP */
 	default:
 	default:
 		__xchg_called_with_bad_pointer();
 		__xchg_called_with_bad_pointer();
-#endif  /* CONFIG_SMP */
 	}
 	}
 
 
 	local_irq_restore(flags);
 	local_irq_restore(flags);