From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031620AbdDTLFe (ORCPT ); Thu, 20 Apr 2017 07:05:34 -0400 Received: from terminus.zytor.com ([65.50.211.136]:41429 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031588AbdDTLFR (ORCPT ); Thu, 20 Apr 2017 07:05:17 -0400 Date: Thu, 20 Apr 2017 04:02:55 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: namhyung@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, jolsa@kernel.org, dsahern@gmail.com, wangnan0@huawei.com, acme@redhat.com, mingo@kernel.org, adrian.hunter@intel.com Reply-To: adrian.hunter@intel.com, mingo@kernel.org, acme@redhat.com, dsahern@gmail.com, wangnan0@huawei.com, jolsa@kernel.org, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, namhyung@kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools include: Introduce linux/bug.h, from the kernel sources Git-Commit-ID: 379d61b1c7d42512cded04d372f15a7e725db9e1 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 379d61b1c7d42512cded04d372f15a7e725db9e1 Gitweb: http://git.kernel.org/tip/379d61b1c7d42512cded04d372f15a7e725db9e1 Author: Arnaldo Carvalho de Melo AuthorDate: Mon, 17 Apr 2017 11:23:41 -0300 Committer: Arnaldo Carvalho de Melo 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 Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-lw8zg7x6ttwcvqhp90mwe3vo@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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