Skip to content

Commit

Permalink
BUG_ON() Conversion in drivers/parisc/
Browse files Browse the repository at this point in the history
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
  • Loading branch information
SesterhennEric authored and AdrianBunk committed Mar 24, 2006
1 parent 089fe1b commit b749455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
10 changes: 3 additions & 7 deletions drivers/parisc/sba_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,9 +1724,7 @@ printk("sba_hw_init(): mem_boot 0x%x 0x%x 0x%x 0x%x\n", PAGE0->mem_boot.hpa,
sba_dev->chip_resv.start = PCI_F_EXTEND | 0xfef00000UL;
sba_dev->chip_resv.end = PCI_F_EXTEND | (0xff000000UL - 1) ;
err = request_resource(&iomem_resource, &(sba_dev->chip_resv));
if (err < 0) {
BUG();
}
BUG_ON(err < 0);

} else if (IS_PLUTO(sba_dev->iodc)) {
int err;
Expand Down Expand Up @@ -2185,8 +2183,7 @@ void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r)
int i;
int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */

if ((t!=HPHW_IOA) && (t!=HPHW_BCPORT))
BUG();
BUG_ON((t!=HPHW_IOA) && (t!=HPHW_BCPORT));

r->start = r->end = 0;

Expand Down Expand Up @@ -2228,8 +2225,7 @@ void sba_distributed_lmmio(struct parisc_device *pci_hba, struct resource *r )
int base, size;
int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1)); /* rope # */

if ((t!=HPHW_IOA) && (t!=HPHW_BCPORT))
BUG();
BUG_ON((t!=HPHW_IOA) && (t!=HPHW_BCPORT));

r->start = r->end = 0;

Expand Down
7 changes: 3 additions & 4 deletions drivers/parisc/superio.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ superio_init(struct pci_dev *pcidev)
if (sio->suckyio_irq_enabled)
return;

if (!pdev) BUG();
if (!sio->usb_pdev) BUG();
BUG_ON(!pdev);
BUG_ON(!sio->usb_pdev);

/* use the IRQ iosapic found for USB INT D... */
pdev->irq = sio->usb_pdev->irq;
Expand Down Expand Up @@ -474,8 +474,7 @@ superio_probe(struct pci_dev *dev, const struct pci_device_id *id)
dev->subsystem_vendor, dev->subsystem_device,
dev->class);

if (!sio->suckyio_irq_enabled)
BUG(); /* Enabled by PCI_FIXUP_FINAL */
BUG_ON(!sio->suckyio_irq_enabled); /* Enabled by PCI_FIXUP_FINAL */

if (dev->device == PCI_DEVICE_ID_NS_87560_LIO) { /* Function 1 */
superio_parport_init();
Expand Down

0 comments on commit b749455

Please sign in to comment.