lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 17 Nov 2014 17:58:55 -0800
From:	Andi Kleen <andi@...stfloor.org>
To:	acme@...nel.org
Cc:	linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 2/2] perf, tools: Remove use of BUILD_BUG_ON

From: Andi Kleen <ak@...ux.intel.com>

BUILD_BUG_ON relies on the gcc optimizer, so it breaks
the build with DEBUG=1 which doesn't use -O2.

Turn the BUILD_BUG_ON into a runtime check again.

Also fix the check to check for 255, not 127.

Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 tools/perf/util/machine.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 5c4d7f8..a24909b 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1446,8 +1446,7 @@ static int remove_loops(struct branch_entry *l, int nr)
 
 	memset(chash, NO_ENTRY, sizeof(chash));
 
-	BUILD_BUG_ON_MSG(PERF_MAX_BRANCH_DEPTH > 127,
-			 "Please upgrade the type of the hash table from unsigned char");
+	BUG_ON(PERF_MAX_BRANCH_DEPTH > 255);
 	for (i = 0; i < nr; i++) {
 		int h = hash_64(l[i].from, CHASHBITS) % CHASHSZ;
 
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists