aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compiler-intel.h
diff options
context:
space:
mode:
authorMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2018-08-30 20:36:59 +0200
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>2018-09-30 20:14:03 +0200
commita3f8a30f3f0079c7edfc72e329eee8594fb3e3cb (patch)
tree8855bb09c0335640b625080fe266e668d9225c16 /include/linux/compiler-intel.h
parentCompiler Attributes: add missing SPDX ID in compiler_types.h (diff)
downloadlinux-dev-a3f8a30f3f0079c7edfc72e329eee8594fb3e3cb.tar.xz
linux-dev-a3f8a30f3f0079c7edfc72e329eee8594fb3e3cb.zip
Compiler Attributes: use feature checks instead of version checks
Instead of using version checks per-compiler to define (or not) each attribute, use __has_attribute to test for them, following the cleanup started with commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive"), which is supported on gcc >= 5, clang >= 2.9 and icc >= 17. In the meantime, to support 4.6 <= gcc < 5, we implement __has_attribute by hand. All the attributes that can be unconditionally defined and directly map to compiler attribute(s) (even if optional) have been moved to a new file include/linux/compiler_attributes.h In an effort to make the file as regular as possible, comments stating the purpose of attributes have been removed. Instead, links to the compiler docs have been added (i.e. to gcc and, if available, to clang as well). In addition, they have been sorted. Finally, if an attribute is optional (i.e. if it is guarded by __has_attribute), the reason has been stated for future reference. Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # on top of v4.19-rc5, clang 7 Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Diffstat (limited to 'include/linux/compiler-intel.h')
-rw-r--r--include/linux/compiler-intel.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index 6004b4588bd4..517bd14e1222 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -34,9 +34,3 @@
/* icc has this, but it's called _bswap16 */
#define __HAVE_BUILTIN_BSWAP16__
#define __builtin_bswap16 _bswap16
-
-/* The following are for compatibility with GCC, from compiler-gcc.h,
- * and may be redefined here because they should not be shared with other
- * compilers, like clang.
- */
-#define __visible __attribute__((__externally_visible__))