mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [tip:perf/core] tools include: Introduce linux/bug.h, from the kernel sources
@ 2017-04-20 11:02 tip-bot for Arnaldo Carvalho de Melo
  0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2017-04-20 11:02 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: namhyung, linux-kernel, hpa, tglx, jolsa, dsahern, wangnan0,
	acme, mingo, adrian.hunter

Commit-ID:  379d61b1c7d42512cded04d372f15a7e725db9e1
Gitweb:     http://git.kernel.org/tip/379d61b1c7d42512cded04d372f15a7e725db9e1
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 17 Apr 2017 11:23:41 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 19 Apr 2017 13:01:42 -0300

tools include: Introduce linux/bug.h, from the kernel sources

With just what we will need in the upcoming changesets, the
BUILD_BUG_ON_ZERO() definition.

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: http://lkml.kernel.org/n/tip-lw8zg7x6ttwcvqhp90mwe3vo@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/include/linux/bug.h | 10 ++++++++++
 tools/perf/MANIFEST       |  1 +
 2 files changed, 11 insertions(+)

diff --git a/tools/include/linux/bug.h b/tools/include/linux/bug.h
new file mode 100644
index 0000000..8e4a4f4
--- /dev/null
+++ b/tools/include/linux/bug.h
@@ -0,0 +1,10 @@
+#ifndef _TOOLS_PERF_LINUX_BUG_H
+#define _TOOLS_PERF_LINUX_BUG_H
+
+/* Force a compilation error if condition is true, but also produce a
+   result (of value 0 and type size_t), so the expression can be used
+   e.g. in a structure initializer (or where-ever else comma expressions
+   aren't permitted). */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
+
+#endif	/* _TOOLS_PERF_LINUX_BUG_H */
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index 89018c7..a29da46 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -64,6 +64,7 @@ tools/include/linux/bitops.h
 tools/include/linux/compiler.h
 tools/include/linux/compiler-gcc.h
 tools/include/linux/coresight-pmu.h
+tools/include/linux/bug.h
 tools/include/linux/filter.h
 tools/include/linux/hash.h
 tools/include/linux/kernel.h

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-20 11:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-20 11:02 [tip:perf/core] tools include: Introduce linux/bug.h, from the kernel sources tip-bot for Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®