public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stoyan Gaydarov <stoyboyker@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Stoyan Gaydarov <stoyboyker@gmail.com>
Subject: [PATCH 04/25] [arm] BUG to BUG_ON changes
Date: Tue, 10 Mar 2009 00:10:29 -0500	[thread overview]
Message-ID: <1236661850-8237-5-git-send-email-stoyboyker@gmail.com> (raw)
In-Reply-To: <1236661850-8237-4-git-send-email-stoyboyker@gmail.com>

Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.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


  reply	other threads:[~2009-03-10  5:13 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-10  5:10 [PATCH 00/25] BUG to BUG_ON changes Stoyan Gaydarov
2009-03-10  5:10 ` [PATCH 01/25] [btrfs] " Stoyan Gaydarov
2009-03-10  5:10   ` [PATCH 02/25] [staging] " Stoyan Gaydarov
2009-03-10  5:10     ` [PATCH 03/25] [net] " Stoyan Gaydarov
2009-03-10  5:10       ` Stoyan Gaydarov [this message]
2009-03-10  5:10         ` [PATCH 05/25] [ia64] " Stoyan Gaydarov
2009-03-10  5:10           ` [PATCH 06/25] [mips] " Stoyan Gaydarov
2009-03-10  5:10             ` [PATCH 07/25] [x86] " Stoyan Gaydarov
2009-03-10  5:10               ` [PATCH 08/25] [sparc] " Stoyan Gaydarov
2009-03-10  5:10                 ` [PATCH 09/25] [s390] " Stoyan Gaydarov
2009-03-10  5:10                   ` [PATCH 10/25] [mn10300] " Stoyan Gaydarov
2009-03-10  5:10                     ` [PATCH 11/25] [alpha] " Stoyan Gaydarov
2009-03-10  5:10                       ` [PATCH 12/25] [frv] " Stoyan Gaydarov
2009-03-10  5:10                         ` [PATCH 13/25] [blackfin] " Stoyan Gaydarov
2009-03-10  5:10                           ` [PATCH 14/25] [mm] " Stoyan Gaydarov
2009-03-10  5:10                             ` [PATCH 15/25] [cris] " Stoyan Gaydarov
2009-03-10  5:10                               ` [PATCH 16/25] [m32r] " Stoyan Gaydarov
2009-03-10  5:10                                 ` [PATCH 17/25] [parisc] " Stoyan Gaydarov
2009-03-10  5:10                                   ` [PATCH 18/25] [xtensa] " Stoyan Gaydarov
2009-03-10  5:10                                     ` [PATCH 19/25] [sysctl.c] " Stoyan Gaydarov
2009-03-10  5:10                                       ` [PATCH 20/25] [scsi] " Stoyan Gaydarov
2009-03-10  5:10                                         ` [PATCH 21/25] [afs] " Stoyan Gaydarov
2009-03-10  5:10                                           ` [PATCH 22/25] [reiserfs] " Stoyan Gaydarov
2009-03-10  5:10                                             ` [PATCH 23/25] [drivers/misc] " Stoyan Gaydarov
2009-03-10  5:10                                               ` [PATCH 24/25] [crypto] " Stoyan Gaydarov
2009-03-10  5:10                                                 ` [PATCH 25/25] [drivers] " Stoyan Gaydarov
2009-03-11 11:54                                           ` [PATCH 21/25] [afs] " David Howells
2009-03-13  4:51                                   ` [PATCH 17/25] [parisc] " Kyle McMartin
2009-03-10  7:49                                 ` [PATCH 16/25] [m32r] " Hirokazu Takata
2009-04-02 11:57                               ` [PATCH 15/25] [cris] " Jesper Nilsson
2009-03-11 11:48                         ` [PATCH 12/25] [frv] " David Howells
2009-03-11 11:36                     ` [PATCH 10/25] [mn10300] " David Howells
2009-03-10 11:17                   ` [PATCH 09/25] [s390] " Christian Borntraeger
2009-03-10  5:16                 ` [PATCH 08/25] [sparc] " David Miller
2009-03-10  8:37               ` [PATCH 07/25] [x86] " Ingo Molnar
2009-03-10  8:57               ` [tip:x86/debug] x86: " Stoyan Gaydarov
2009-03-11 19:18             ` [PATCH 06/25] [mips] " Ralf Baechle
2009-03-10  5:16       ` [PATCH 03/25] [net] " David Miller
2009-03-10 10:23       ` Alexey Dobriyan
2009-03-10 11:24         ` David Miller
2009-03-10 19:54       ` Brandeburg, Jesse
2009-03-10 10:22     ` [PATCH 02/25] [staging] " Alexey Dobriyan
2009-03-10  9:16   ` [PATCH 01/25] [btrfs] " David John
2009-03-10 18:16     ` Stoyan Gaydarov
2009-03-10 18:20       ` Oliver Mattos
2009-03-10 13:24   ` Chris Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1236661850-8237-5-git-send-email-stoyboyker@gmail.com \
    --to=stoyboyker@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox