diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/byteorder/generic.h | 2 | ||||
-rw-r--r-- | include/linux/byteorder/swab.h | 2 | ||||
-rw-r--r-- | include/linux/byteorder/swabb.h | 2 | ||||
-rw-r--r-- | include/linux/compiler-gcc.h | 9 | ||||
-rw-r--r-- | include/linux/compiler-gcc3.h | 17 | ||||
-rw-r--r-- | include/linux/compiler-gcc4.h | 7 | ||||
-rw-r--r-- | include/linux/kernel.h | 2 | ||||
-rw-r--r-- | include/linux/seccomp.h | 6 | ||||
-rw-r--r-- | include/linux/spinlock_types_up.h | 14 |
9 files changed, 13 insertions, 48 deletions
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h index 04bd756efc67..e86e4a938373 100644 --- a/include/linux/byteorder/generic.h +++ b/include/linux/byteorder/generic.h | |||
@@ -156,7 +156,7 @@ extern __be32 htonl(__u32); | |||
156 | extern __u16 ntohs(__be16); | 156 | extern __u16 ntohs(__be16); |
157 | extern __be16 htons(__u16); | 157 | extern __be16 htons(__u16); |
158 | 158 | ||
159 | #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | 159 | #if defined(__GNUC__) && defined(__OPTIMIZE__) |
160 | 160 | ||
161 | #define ___htonl(x) __cpu_to_be32(x) | 161 | #define ___htonl(x) __cpu_to_be32(x) |
162 | #define ___htons(x) __cpu_to_be16(x) | 162 | #define ___htons(x) __cpu_to_be16(x) |
diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h index 2f1cb775125a..25f7f32883ec 100644 --- a/include/linux/byteorder/swab.h +++ b/include/linux/byteorder/swab.h | |||
@@ -110,7 +110,7 @@ | |||
110 | /* | 110 | /* |
111 | * Allow constant folding | 111 | * Allow constant folding |
112 | */ | 112 | */ |
113 | #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | 113 | #if defined(__GNUC__) && defined(__OPTIMIZE__) |
114 | # define __swab16(x) \ | 114 | # define __swab16(x) \ |
115 | (__builtin_constant_p((__u16)(x)) ? \ | 115 | (__builtin_constant_p((__u16)(x)) ? \ |
116 | ___swab16((x)) : \ | 116 | ___swab16((x)) : \ |
diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h index d5f2a3205109..ae5e5f914bf4 100644 --- a/include/linux/byteorder/swabb.h +++ b/include/linux/byteorder/swabb.h | |||
@@ -77,7 +77,7 @@ | |||
77 | /* | 77 | /* |
78 | * Allow constant folding | 78 | * Allow constant folding |
79 | */ | 79 | */ |
80 | #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | 80 | #if defined(__GNUC__) && defined(__OPTIMIZE__) |
81 | # define __swahw32(x) \ | 81 | # define __swahw32(x) \ |
82 | (__builtin_constant_p((__u32)(x)) ? \ | 82 | (__builtin_constant_p((__u32)(x)) ? \ |
83 | ___swahw32((x)) : \ | 83 | ___swahw32((x)) : \ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 152734055403..2e05e1e6b0e6 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -15,3 +15,12 @@ | |||
15 | ({ unsigned long __ptr; \ | 15 | ({ unsigned long __ptr; \ |
16 | __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \ | 16 | __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \ |
17 | (typeof(ptr)) (__ptr + (off)); }) | 17 | (typeof(ptr)) (__ptr + (off)); }) |
18 | |||
19 | |||
20 | #define inline inline __attribute__((always_inline)) | ||
21 | #define __inline__ __inline__ __attribute__((always_inline)) | ||
22 | #define __inline __inline __attribute__((always_inline)) | ||
23 | #define __deprecated __attribute__((deprecated)) | ||
24 | #define noinline __attribute__((noinline)) | ||
25 | #define __attribute_pure__ __attribute__((pure)) | ||
26 | #define __attribute_const__ __attribute__((__const__)) | ||
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index a6fa615afab5..4209082ee934 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -3,29 +3,12 @@ | |||
3 | /* These definitions are for GCC v3.x. */ | 3 | /* These definitions are for GCC v3.x. */ |
4 | #include <linux/compiler-gcc.h> | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | ||
6 | #if __GNUC_MINOR__ >= 1 | ||
7 | # define inline inline __attribute__((always_inline)) | ||
8 | # define __inline__ __inline__ __attribute__((always_inline)) | ||
9 | # define __inline __inline __attribute__((always_inline)) | ||
10 | #endif | ||
11 | |||
12 | #if __GNUC_MINOR__ > 0 | ||
13 | # define __deprecated __attribute__((deprecated)) | ||
14 | #endif | ||
15 | |||
16 | #if __GNUC_MINOR__ >= 3 | 6 | #if __GNUC_MINOR__ >= 3 |
17 | # define __attribute_used__ __attribute__((__used__)) | 7 | # define __attribute_used__ __attribute__((__used__)) |
18 | #else | 8 | #else |
19 | # define __attribute_used__ __attribute__((__unused__)) | 9 | # define __attribute_used__ __attribute__((__unused__)) |
20 | #endif | 10 | #endif |
21 | 11 | ||
22 | #define __attribute_pure__ __attribute__((pure)) | ||
23 | #define __attribute_const__ __attribute__((__const__)) | ||
24 | |||
25 | #if __GNUC_MINOR__ >= 1 | ||
26 | #define noinline __attribute__((noinline)) | ||
27 | #endif | ||
28 | |||
29 | #if __GNUC_MINOR__ >= 4 | 12 | #if __GNUC_MINOR__ >= 4 |
30 | #define __must_check __attribute__((warn_unused_result)) | 13 | #define __must_check __attribute__((warn_unused_result)) |
31 | #endif | 14 | #endif |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 53686c037a06..e913e9beaf69 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -3,14 +3,7 @@ | |||
3 | /* These definitions are for GCC v4.x. */ | 3 | /* These definitions are for GCC v4.x. */ |
4 | #include <linux/compiler-gcc.h> | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | ||
6 | #define inline inline __attribute__((always_inline)) | ||
7 | #define __inline__ __inline__ __attribute__((always_inline)) | ||
8 | #define __inline __inline __attribute__((always_inline)) | ||
9 | #define __deprecated __attribute__((deprecated)) | ||
10 | #define __attribute_used__ __attribute__((__used__)) | 6 | #define __attribute_used__ __attribute__((__used__)) |
11 | #define __attribute_pure__ __attribute__((pure)) | ||
12 | #define __attribute_const__ __attribute__((__const__)) | ||
13 | #define noinline __attribute__((noinline)) | ||
14 | #define __must_check __attribute__((warn_unused_result)) | 7 | #define __must_check __attribute__((warn_unused_result)) |
15 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 8 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
16 | 9 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b1e407a4fbda..ca7ff8fdd090 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -316,8 +316,6 @@ extern int randomize_va_space; | |||
316 | #endif | 316 | #endif |
317 | 317 | ||
318 | /* Trap pasters of __FUNCTION__ at compile-time */ | 318 | /* Trap pasters of __FUNCTION__ at compile-time */ |
319 | #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95 | ||
320 | #define __FUNCTION__ (__func__) | 319 | #define __FUNCTION__ (__func__) |
321 | #endif | ||
322 | 320 | ||
323 | #endif | 321 | #endif |
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index dc89116bb1ca..cd2773b29a64 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
@@ -26,11 +26,7 @@ static inline int has_secure_computing(struct thread_info *ti) | |||
26 | 26 | ||
27 | #else /* CONFIG_SECCOMP */ | 27 | #else /* CONFIG_SECCOMP */ |
28 | 28 | ||
29 | #if (__GNUC__ > 2) | 29 | typedef struct { } seccomp_t; |
30 | typedef struct { } seccomp_t; | ||
31 | #else | ||
32 | typedef struct { int gcc_is_buggy; } seccomp_t; | ||
33 | #endif | ||
34 | 30 | ||
35 | #define secure_computing(x) do { } while (0) | 31 | #define secure_computing(x) do { } while (0) |
36 | /* static inline to preserve typechecking */ | 32 | /* static inline to preserve typechecking */ |
diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h index def2d173a8db..04135b0e198e 100644 --- a/include/linux/spinlock_types_up.h +++ b/include/linux/spinlock_types_up.h | |||
@@ -22,30 +22,16 @@ typedef struct { | |||
22 | 22 | ||
23 | #else | 23 | #else |
24 | 24 | ||
25 | /* | ||
26 | * All gcc 2.95 versions and early versions of 2.96 have a nasty bug | ||
27 | * with empty initializers. | ||
28 | */ | ||
29 | #if (__GNUC__ > 2) | ||
30 | typedef struct { } raw_spinlock_t; | 25 | typedef struct { } raw_spinlock_t; |
31 | 26 | ||
32 | #define __RAW_SPIN_LOCK_UNLOCKED { } | 27 | #define __RAW_SPIN_LOCK_UNLOCKED { } |
33 | #else | ||
34 | typedef struct { int gcc_is_buggy; } raw_spinlock_t; | ||
35 | #define __RAW_SPIN_LOCK_UNLOCKED (raw_spinlock_t) { 0 } | ||
36 | #endif | ||
37 | 28 | ||
38 | #endif | 29 | #endif |
39 | 30 | ||
40 | #if (__GNUC__ > 2) | ||
41 | typedef struct { | 31 | typedef struct { |
42 | /* no debug version on UP */ | 32 | /* no debug version on UP */ |
43 | } raw_rwlock_t; | 33 | } raw_rwlock_t; |
44 | 34 | ||
45 | #define __RAW_RW_LOCK_UNLOCKED { } | 35 | #define __RAW_RW_LOCK_UNLOCKED { } |
46 | #else | ||
47 | typedef struct { int gcc_is_buggy; } raw_rwlock_t; | ||
48 | #define __RAW_RW_LOCK_UNLOCKED (raw_rwlock_t) { 0 } | ||
49 | #endif | ||
50 | 36 | ||
51 | #endif /* __LINUX_SPINLOCK_TYPES_UP_H */ | 37 | #endif /* __LINUX_SPINLOCK_TYPES_UP_H */ |