Commit ae86fb4f authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Remove spinlock workaround for pre 2.95 gccs

Remove the empty initializer workaround that was added for egcs 1.1.
Only 2.95+ is supported now, so all compilers should support empty
structures.

The if just checked for __GNUC__, which means that 2.95 got
the workaround (and the incompatibility) too even though it didn't need it.

Advantage is that gcc 2.95 and 3.x compiled kernels are now potentially
binary compatible.  Module loading still checks the compiler version,
but it might be removable.
parent f5d256f8
...@@ -146,13 +146,8 @@ typedef struct { ...@@ -146,13 +146,8 @@ typedef struct {
/* /*
* gcc versions before ~2.95 have a nasty bug with empty initializers. * gcc versions before ~2.95 have a nasty bug with empty initializers.
*/ */
#if (__GNUC__ > 2) typedef struct { } spinlock_t;
typedef struct { } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#else
typedef struct { int gcc_is_buggy; } spinlock_t;
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#endif
/* /*
* If CONFIG_SMP is unset, declare the _raw_* definitions as nops * If CONFIG_SMP is unset, declare the _raw_* definitions as nops
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment