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  linux-hardening  linux-cve-announce  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:	Tue, 10 Mar 2009 00:10:33 -0500
From:	Stoyan Gaydarov <stoyboyker@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Stoyan Gaydarov <stoyboyker@...il.com>, davem@...emloft.net,
	sparclinux@...r.kernel.org
Subject: [PATCH 08/25] [sparc] BUG to BUG_ON changes

Signed-off-by: Stoyan Gaydarov <stoyboyker@...il.com>
---
 arch/sparc/kernel/traps_64.c |    3 +--
 arch/sparc/lib/bitext.c      |   17 +++++++----------
 arch/sparc/mm/srmmu.c        |    3 +--
 3 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index d809c4e..5cd6b4c 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -366,8 +366,7 @@ static void spitfire_clean_and_reenable_l1_caches(void)
 {
 	unsigned long va;
 
-	if (tlb_type != spitfire)
-		BUG();
+	BUG_ON(tlb_type != spitfire);
 
 	/* Clean 'em. */
 	for (va =  0; va < (PAGE_SIZE << 1); va += 32) {
diff --git a/arch/sparc/lib/bitext.c b/arch/sparc/lib/bitext.c
index 764b3eb..bc1007e 100644
--- a/arch/sparc/lib/bitext.c
+++ b/arch/sparc/lib/bitext.c
@@ -41,12 +41,11 @@ int bit_map_string_get(struct bit_map *t, int len, int align)
 			align = 1;
 	}
 	align1 = align - 1;
-	if ((align & align1) != 0)
-		BUG();
-	if (align < 0 || align >= t->size)
-		BUG();
-	if (len <= 0 || len > t->size)
-		BUG();
+
+	BUG_ON((align & align1) != 0);
+	BUG_ON(align < 0 || align >= t->size);
+	BUG_ON(len <= 0 || len > t->size);
+
 	color &= align1;
 
 	spin_lock(&t->lock);
@@ -104,8 +103,7 @@ void bit_map_clear(struct bit_map *t, int offset, int len)
 {
 	int i;
 
-	if (t->used < len)
-		BUG();		/* Much too late to do any good, but alas... */
+	BUG_ON(t->used < len);	/* Much too late to do any good, but alas... */
 	spin_lock(&t->lock);
 	for (i = 0; i < len; i++) {
 		if (test_bit(offset + i, t->map) == 0)
@@ -121,8 +119,7 @@ void bit_map_clear(struct bit_map *t, int offset, int len)
 void bit_map_init(struct bit_map *t, unsigned long *map, int size)
 {
 
-	if ((size & 07) != 0)
-		BUG();
+	BUG_ON((size & 07) != 0);
 	memset(map, 0, size>>3);
 
 	memset(t, 0, sizeof *t);
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index fe7ed08..5ea4dab 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -513,8 +513,7 @@ static void srmmu_pte_free(pgtable_t pte)
 
 	pgtable_page_dtor(pte);
 	p = (unsigned long)page_address(pte);	/* Cached address (for test) */
-	if (p == 0)
-		BUG();
+	BUG_ON(p == 0);
 	p = page_to_pfn(pte) << PAGE_SHIFT;	/* Physical address */
 	p = (unsigned long) __nocache_va(p);	/* Nocached virtual */
 	srmmu_free_nocache(p, PTE_SIZE);
-- 
1.6.1.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

Powered by Openwall GNU/*/Linux Powered by OpenVZ