Skip to content

Commit b749455

Browse files
SesterhennEricAdrianBunk
authored andcommitted
BUG_ON() Conversion in drivers/parisc/
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>
1 parent 089fe1b commit b749455

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

‎drivers/parisc/sba_iommu.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,9 +1724,7 @@ printk("sba_hw_init(): mem_boot 0x%x 0x%x 0x%x 0x%x\n", PAGE0->mem_boot.hpa,
17241724
sba_dev->chip_resv.start = PCI_F_EXTEND | 0xfef00000UL;
17251725
sba_dev->chip_resv.end = PCI_F_EXTEND | (0xff000000UL - 1) ;
17261726
err = request_resource(&iomem_resource, &(sba_dev->chip_resv));
1727-
if (err < 0) {
1728-
BUG();
1729-
}
1727+
BUG_ON(err < 0);
17301728

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

2188-
if ((t!=HPHW_IOA) && (t!=HPHW_BCPORT))
2189-
BUG();
2186+
BUG_ON((t!=HPHW_IOA) && (t!=HPHW_BCPORT));
21902187

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

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

2231-
if ((t!=HPHW_IOA) && (t!=HPHW_BCPORT))
2232-
BUG();
2228+
BUG_ON((t!=HPHW_IOA) && (t!=HPHW_BCPORT));
22332229

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

‎drivers/parisc/superio.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ superio_init(struct pci_dev *pcidev)
157157
if (sio->suckyio_irq_enabled)
158158
return;
159159

160-
if (!pdev) BUG();
161-
if (!sio->usb_pdev) BUG();
160+
BUG_ON(!pdev);
161+
BUG_ON(!sio->usb_pdev);
162162

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

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

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

0 commit comments

Comments
 (0)