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:29 -0500
From:	Stoyan Gaydarov <stoyboyker@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Stoyan Gaydarov <stoyboyker@...il.com>
Subject: [PATCH 04/25] [arm] BUG to BUG_ON changes

Signed-off-by: Stoyan Gaydarov <stoyboyker@...il.com>
---
 arch/arm/common/gic.c             |    9 +++------
 arch/arm/mach-ebsa110/io.c        |   24 ++++++++----------------
 arch/arm/mach-integrator/pci_v3.c |    9 +++------
 arch/arm/mach-rpc/dma.c           |    3 +--
 arch/arm/mach-versatile/pci.c     |    9 +++------
 arch/arm/mm/init.c                |    3 +--
 6 files changed, 19 insertions(+), 38 deletions(-)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index c6884ba..3b230a7 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -166,8 +166,7 @@ static struct irq_chip gic_chip = {
 
 void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
 {
-	if (gic_nr >= MAX_GIC_NR)
-		BUG();
+	BUG_ON(gic_nr >= MAX_GIC_NR);
 	if (set_irq_data(irq, &gic_data[gic_nr]) != 0)
 		BUG();
 	set_irq_chained_handler(irq, gic_handle_cascade_irq);
@@ -179,8 +178,7 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
 	unsigned int max_irq, i;
 	u32 cpumask = 1 << smp_processor_id();
 
-	if (gic_nr >= MAX_GIC_NR)
-		BUG();
+	BUG_ON(gic_nr >= MAX_GIC_NR);
 
 	cpumask |= cpumask << 8;
 	cpumask |= cpumask << 16;
@@ -243,8 +241,7 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base,
 
 void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base)
 {
-	if (gic_nr >= MAX_GIC_NR)
-		BUG();
+	BUG_ON(gic_nr >= MAX_GIC_NR);
 
 	gic_data[gic_nr].cpu_base = base;
 
diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c
index c52e304..0a6ec5b 100644
--- a/arch/arm/mach-ebsa110/io.c
+++ b/arch/arm/mach-ebsa110/io.c
@@ -79,8 +79,7 @@ u16 __readw(const volatile void __iomem *addr)
 {
 	void __iomem *a = __isamem_convert_addr(addr);
 
-	if ((unsigned long)addr & 1)
-		BUG();
+	BUG_ON((unsigned long)addr & 1);
 
 	return __raw_readw(a);
 }
@@ -90,8 +89,7 @@ u32 __readl(const volatile void __iomem *addr)
 	void __iomem *a = __isamem_convert_addr(addr);
 	u32 ret;
 
-	if ((unsigned long)addr & 3)
-		BUG();
+	BUG_ON((unsigned long)addr & 3);
 
 	ret = __raw_readw(a);
 	ret |= __raw_readw(a + 4) << 16;
@@ -136,8 +134,7 @@ void __writew(u16 val, void __iomem *addr)
 {
 	void __iomem *a = __isamem_convert_addr(addr);
 
-	if ((unsigned long)addr & 1)
-		BUG();
+	BUG_ON((unsigned long)addr & 1);
 
 	__raw_writew(val, a);
 }
@@ -146,8 +143,7 @@ void __writel(u32 val, void __iomem *addr)
 {
 	void __iomem *a = __isamem_convert_addr(addr);
 
-	if ((unsigned long)addr & 3)
-		BUG();
+	BUG_ON((unsigned long)addr & 3);
 
 	__raw_writew(val, a);
 	__raw_writew(val >> 16, a + 4);
@@ -333,8 +329,7 @@ void outsb(unsigned int port, const void *from, int len)
 		off = port << 2;
 	else {
 		off = (port & ~1) << 1;
-		if (port & 1)
-			BUG();
+		BUG_ON(port & 1);
 	}
 
 	__raw_writesb((void __iomem *)ISAIO_BASE + off, from, len);
@@ -348,8 +343,7 @@ void insb(unsigned int port, void *from, int len)
 		off = port << 2;
 	else {
 		off = (port & ~1) << 1;
-		if (port & 1)
-			BUG();
+		BUG_ON(port & 1);
 	}
 
 	__raw_readsb((void __iomem *)ISAIO_BASE + off, from, len);
@@ -366,8 +360,7 @@ void outsw(unsigned int port, const void *from, int len)
 		off = port << 2;
 	else {
 		off = (port & ~1) << 1;
-		if (port & 1)
-			BUG();
+		BUG_ON(port & 1);
 	}
 
 	__raw_writesw((void __iomem *)ISAIO_BASE + off, from, len);
@@ -381,8 +374,7 @@ void insw(unsigned int port, void *from, int len)
 		off = port << 2;
 	else {
 		off = (port & ~1) << 1;
-		if (port & 1)
-			BUG();
+		BUG_ON(port & 1);
 	}
 
 	__raw_readsw((void __iomem *)ISAIO_BASE + off, from, len);
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index f1d72b2..f8514fb 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -190,12 +190,9 @@ static unsigned long v3_open_config_window(struct pci_bus *bus,
 	/*
 	 * Trap out illegal values
 	 */
-	if (offset > 255)
-		BUG();
-	if (busnr > 255)
-		BUG();
-	if (devfn > 255)
-		BUG();
+	BUG_ON(offset > 255);
+	BUG_ON(busnr > 255);
+	BUG_ON(devfn > 255);
 
 	if (busnr == 0) {
 		int slot = PCI_SLOT(devfn);
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c
index 7958a30..3fc0232 100644
--- a/arch/arm/mach-rpc/dma.c
+++ b/arch/arm/mach-rpc/dma.c
@@ -242,8 +242,7 @@ static void floppy_enable_dma(dmach_t channel, dma_t *dma)
 	unsigned int fiqhandler_length;
 	struct pt_regs regs;
 
-	if (dma->sg)
-		BUG();
+	BUG_ON(dma->sg);
 
 	if (dma->dma_mode == DMA_MODE_READ) {
 		extern unsigned char floppy_fiqin_start, floppy_fiqin_end;
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index 7161ba2..ba910ab 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -84,12 +84,9 @@ static void __iomem *__pci_addr(struct pci_bus *bus,
 	/*
 	 * Trap out illegal values
 	 */
-	if (offset > 255)
-		BUG();
-	if (busnr > 255)
-		BUG();
-	if (devfn > 255)
-		BUG();
+	BUG_ON(offset > 255);
+	BUG_ON(busnr > 255);
+	BUG_ON(devfn > 255);
 
 	return VERSATILE_PCI_CFG_VIRT_BASE + ((busnr << 16) |
 		(PCI_SLOT(devfn) << 11) | (PCI_FUNC(devfn) << 8) | offset);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 34df4d9..67eba64 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -155,8 +155,7 @@ find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
 		}
 	}
 
-	if (bootmap_pfn == 0)
-		BUG();
+	BUG_ON(bootmap_pfn == 0);
 
 	return bootmap_pfn;
 }
-- 
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