summaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
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 /mm/slab_common.c
parent66dbeef915f275dad6c8656b31667ef9640f5639 (diff)
downloadlinux-a3f8a30f3f0079c7edfc72e329eee8594fb3e3cb.tar.gz
linux-a3f8a30f3f0079c7edfc72e329eee8594fb3e3cb.tar.bz2
linux-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 'mm/slab_common.c')
0 files changed, 0 insertions, 0 deletions