--- spinlock.h.org 2005-10-16 17:30:51.000000000 +0000 +++ spinlock.h 2005-10-16 15:25:27.000000000 +0000 @@ -34,6 +34,15 @@ #define __lockfunc fastcall __attribute__((section(".spinlock.text"))) +#if (__GNUC__ > 2) + typedef struct { } rwlock_t; + #define RW_LOCK_UNLOCKED (rwlock_t) { } +#else + typedef struct { int gcc_is_buggy; } rwlock_t; + #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } +#endif + + /* * If CONFIG_SMP is set, pull in the _raw_* definitions */ @@ -219,14 +228,6 @@ /* RW spinlocks: No debug version */ -#if (__GNUC__ > 2) - typedef struct { } rwlock_t; - #define RW_LOCK_UNLOCKED (rwlock_t) { } -#else - typedef struct { int gcc_is_buggy; } rwlock_t; - #define RW_LOCK_UNLOCKED (rwlock_t) { 0 } -#endif - #define rwlock_init(lock) do { (void)(lock); } while(0) #define _raw_read_lock(lock) do { (void)(lock); } while(0) #define _raw_read_unlock(lock) do { (void)(lock); } while(0)