summaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-05-17 15:12:36 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-05-17 15:17:21 -0300
commit6e1690c4c0b540930f08295b6a95c8660b257745 (patch)
tree087d0a90ca6494d7022e0b91f74e8bbba48b56f2 /tools/include
parent789e465058352122023e4fa7de8dcf5c513e0b0b (diff)
downloadlinux-6e1690c4c0b540930f08295b6a95c8660b257745.tar.bz2
tools include compiler-gcc: Add __pure attribute helper
Adopt it from the kernel sources, will be used soon. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-oubheiqj8edo5rzewt11cbn0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/linux/compiler-gcc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/include/linux/compiler-gcc.h b/tools/include/linux/compiler-gcc.h
index a3a4427441bf..70fe61295733 100644
--- a/tools/include/linux/compiler-gcc.h
+++ b/tools/include/linux/compiler-gcc.h
@@ -21,6 +21,9 @@
/* &a[0] degrades to a pointer: a different type from an array */
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
+#ifndef __pure
+#define __pure __attribute__((pure))
+#endif
#define noinline __attribute__((noinline))
#ifndef __packed
#define __packed __attribute__((packed))