diff options
author | Daniel Santos <daniel.santos@pobox.com> | 2013-02-21 19:41:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:15 -0500 |
commit | 6640dfdf6fff387c0a8f7fb8ac1d47c6b093484e (patch) | |
tree | dac52a5d940edef3728ed2609b965cee162bdbcb /include/linux/compiler-gcc4.h | |
parent | 53eb8c82d581fdd4b389a3e417261f3ae924e603 (diff) |
compiler-gcc4.h: Reorder macros based upon gcc ver
This helps to keep the file from getting confusing, removes one
duplicate version check and should encourage future editors to put new
macros where they belong.
Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Borislav Petkov <bp@alien8.de>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Joe Perches <joe@perches.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/compiler-gcc4.h')
-rw-r--r-- | include/linux/compiler-gcc4.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 662fd1b4c42a..c9785c22744e 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -13,6 +13,10 @@ | |||
13 | #define __must_check __attribute__((warn_unused_result)) | 13 | #define __must_check __attribute__((warn_unused_result)) |
14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
15 | 15 | ||
16 | #if __GNUC_MINOR__ > 0 | ||
17 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
18 | #endif | ||
19 | |||
16 | #if __GNUC_MINOR__ >= 3 | 20 | #if __GNUC_MINOR__ >= 3 |
17 | /* Mark functions as cold. gcc will assume any path leading to a call | 21 | /* Mark functions as cold. gcc will assume any path leading to a call |
18 | to them will be unlikely. This means a lot of manual unlikely()s | 22 | to them will be unlikely. This means a lot of manual unlikely()s |
@@ -33,6 +37,12 @@ | |||
33 | 37 | ||
34 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) | 38 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) |
35 | 39 | ||
40 | #ifndef __CHECKER__ | ||
41 | # define __compiletime_warning(message) __attribute__((warning(message))) | ||
42 | # define __compiletime_error(message) __attribute__((error(message))) | ||
43 | #endif /* __CHECKER__ */ | ||
44 | #endif /* __GNUC_MINOR__ >= 3 */ | ||
45 | |||
36 | #if __GNUC_MINOR__ >= 5 | 46 | #if __GNUC_MINOR__ >= 5 |
37 | /* | 47 | /* |
38 | * Mark a position in code as unreachable. This can be used to | 48 | * Mark a position in code as unreachable. This can be used to |
@@ -48,8 +58,7 @@ | |||
48 | /* Mark a function definition as prohibited from being cloned. */ | 58 | /* Mark a function definition as prohibited from being cloned. */ |
49 | #define __noclone __attribute__((__noclone__)) | 59 | #define __noclone __attribute__((__noclone__)) |
50 | 60 | ||
51 | #endif | 61 | #endif /* __GNUC_MINOR__ >= 5 */ |
52 | #endif | ||
53 | 62 | ||
54 | #if __GNUC_MINOR__ >= 6 | 63 | #if __GNUC_MINOR__ >= 6 |
55 | /* | 64 | /* |
@@ -58,13 +67,6 @@ | |||
58 | #define __visible __attribute__((externally_visible)) | 67 | #define __visible __attribute__((externally_visible)) |
59 | #endif | 68 | #endif |
60 | 69 | ||
61 | #if __GNUC_MINOR__ > 0 | ||
62 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
63 | #endif | ||
64 | #if __GNUC_MINOR__ >= 3 && !defined(__CHECKER__) | ||
65 | #define __compiletime_warning(message) __attribute__((warning(message))) | ||
66 | #define __compiletime_error(message) __attribute__((error(message))) | ||
67 | #endif | ||
68 | 70 | ||
69 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP | 71 | #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP |
70 | #if __GNUC_MINOR__ >= 4 | 72 | #if __GNUC_MINOR__ >= 4 |