[PATCH] Fix i386 SPINLOCK_MAGIC debugging

From: Zwane Mwaikambo
Date: Thu Sep 09 2004 - 21:59:01 EST


Using a label isn't sufficent anymore for determining the location of the
failed lock. Use __builtin_return_address instead.

Signed-off-by: Zwane Mwaikambo <zwane@xxxxxxxxxxx>

--- linux-2.6-bk/include/asm-i386/spinlock.h.orig 2004-09-09 11:16:43.206108976 -0400
+++ linux-2.6-bk/include/asm-i386/spinlock.h 2004-09-09 11:18:18.131678096 -0400
@@ -128,10 +128,8 @@ static inline int _raw_spin_trylock(spin
static inline void _raw_spin_lock(spinlock_t *lock)
{
#ifdef CONFIG_DEBUG_SPINLOCK
- __label__ here;
-here:
if (unlikely(lock->magic != SPINLOCK_MAGIC)) {
- printk("eip: %p\n", &&here);
+ printk("eip: %p\n", __builtin_return_address(0));
BUG();
}
#endif
@@ -143,10 +141,8 @@ here:
static inline void _raw_spin_lock_flags (spinlock_t *lock, unsigned long flags)
{
#ifdef CONFIG_DEBUG_SPINLOCK
- __label__ here;
-here:
if (unlikely(lock->magic != SPINLOCK_MAGIC)) {
- printk("eip: %p\n", &&here);
+ printk("eip: %p\n", __builtin_return_address(0));
BUG();
}
#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/