Skip to content

Commit

Permalink
ARM: integrator: use BUG_ON where possible
Browse files Browse the repository at this point in the history
Just use BUG_ON() instead of constructions such as:

	if (...)
		BUG()

A simplified version of the semantic patch that makes this transformation
is as follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e;
@@
- if (e) BUG();
+ BUG_ON(e);
// </smpl>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Sasha Levin authored and Linus Walleij committed Nov 17, 2012
1 parent 379df27 commit f7a9b36
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions arch/arm/mach-integrator/pci_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,9 @@ static void __iomem *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);
Expand Down

0 comments on commit f7a9b36

Please sign in to comment.