[PATCH] remove gcc-2 checks
Remove various things which were checking for gcc-1.x and gcc-2.x compilers. From: Adrian Bunk <bunk@stusta.de> Some documentation updates and removes some code paths for gcc < 3.2. Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
fd285bb54d
commit
a136564702
32 changed files with 37 additions and 194 deletions
|
@ -156,7 +156,7 @@ extern __be32 htonl(__u32);
|
|||
extern __u16 ntohs(__be16);
|
||||
extern __be16 htons(__u16);
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
|
||||
#define ___htonl(x) __cpu_to_be32(x)
|
||||
#define ___htons(x) __cpu_to_be16(x)
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
/*
|
||||
* Allow constant folding
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
# define __swab16(x) \
|
||||
(__builtin_constant_p((__u16)(x)) ? \
|
||||
___swab16((x)) : \
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
/*
|
||||
* Allow constant folding
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
# define __swahw32(x) \
|
||||
(__builtin_constant_p((__u32)(x)) ? \
|
||||
___swahw32((x)) : \
|
||||
|
|
|
@ -15,3 +15,12 @@
|
|||
({ unsigned long __ptr; \
|
||||
__asm__ ("" : "=g"(__ptr) : "0"(ptr)); \
|
||||
(typeof(ptr)) (__ptr + (off)); })
|
||||
|
||||
|
||||
#define inline inline __attribute__((always_inline))
|
||||
#define __inline__ __inline__ __attribute__((always_inline))
|
||||
#define __inline __inline __attribute__((always_inline))
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
#define noinline __attribute__((noinline))
|
||||
#define __attribute_pure__ __attribute__((pure))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
|
|
|
@ -3,29 +3,12 @@
|
|||
/* These definitions are for GCC v3.x. */
|
||||
#include <linux/compiler-gcc.h>
|
||||
|
||||
#if __GNUC_MINOR__ >= 1
|
||||
# define inline inline __attribute__((always_inline))
|
||||
# define __inline__ __inline__ __attribute__((always_inline))
|
||||
# define __inline __inline __attribute__((always_inline))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ > 0
|
||||
# define __deprecated __attribute__((deprecated))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 3
|
||||
# define __attribute_used__ __attribute__((__used__))
|
||||
#else
|
||||
# define __attribute_used__ __attribute__((__unused__))
|
||||
#endif
|
||||
|
||||
#define __attribute_pure__ __attribute__((pure))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
|
||||
#if __GNUC_MINOR__ >= 1
|
||||
#define noinline __attribute__((noinline))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 4
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#endif
|
||||
|
|
|
@ -3,14 +3,7 @@
|
|||
/* These definitions are for GCC v4.x. */
|
||||
#include <linux/compiler-gcc.h>
|
||||
|
||||
#define inline inline __attribute__((always_inline))
|
||||
#define __inline__ __inline__ __attribute__((always_inline))
|
||||
#define __inline __inline __attribute__((always_inline))
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
#define __attribute_used__ __attribute__((__used__))
|
||||
#define __attribute_pure__ __attribute__((pure))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
#define noinline __attribute__((noinline))
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
|
||||
|
||||
|
|
|
@ -316,8 +316,6 @@ extern int randomize_va_space;
|
|||
#endif
|
||||
|
||||
/* Trap pasters of __FUNCTION__ at compile-time */
|
||||
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
|
||||
#define __FUNCTION__ (__func__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,11 +26,7 @@ static inline int has_secure_computing(struct thread_info *ti)
|
|||
|
||||
#else /* CONFIG_SECCOMP */
|
||||
|
||||
#if (__GNUC__ > 2)
|
||||
typedef struct { } seccomp_t;
|
||||
#else
|
||||
typedef struct { int gcc_is_buggy; } seccomp_t;
|
||||
#endif
|
||||
typedef struct { } seccomp_t;
|
||||
|
||||
#define secure_computing(x) do { } while (0)
|
||||
/* static inline to preserve typechecking */
|
||||
|
|
|
@ -22,30 +22,16 @@ typedef struct {
|
|||
|
||||
#else
|
||||
|
||||
/*
|
||||
* All gcc 2.95 versions and early versions of 2.96 have a nasty bug
|
||||
* with empty initializers.
|
||||
*/
|
||||
#if (__GNUC__ > 2)
|
||||
typedef struct { } raw_spinlock_t;
|
||||
|
||||
#define __RAW_SPIN_LOCK_UNLOCKED { }
|
||||
#else
|
||||
typedef struct { int gcc_is_buggy; } raw_spinlock_t;
|
||||
#define __RAW_SPIN_LOCK_UNLOCKED (raw_spinlock_t) { 0 }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ > 2)
|
||||
typedef struct {
|
||||
/* no debug version on UP */
|
||||
} raw_rwlock_t;
|
||||
|
||||
#define __RAW_RW_LOCK_UNLOCKED { }
|
||||
#else
|
||||
typedef struct { int gcc_is_buggy; } raw_rwlock_t;
|
||||
#define __RAW_RW_LOCK_UNLOCKED (raw_rwlock_t) { 0 }
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_SPINLOCK_TYPES_UP_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue