diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-04-02 07:52:48 -0400 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-04-02 07:52:48 -0400 |
commit | 5d9428de1a9785f10a4339f80b717be665ba51c7 (patch) | |
tree | 27eeed8a87ef248cec694032463f0d8f3b38fbcc /drivers/net/8139cp.c | |
parent | 7e99e9b66336565f0088ea59d848ab187f9689c3 (diff) |
BUG_ON() Conversion in drivers/net/
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>
Diffstat (limited to 'drivers/net/8139cp.c')
-rw-r--r-- | drivers/net/8139cp.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index ce99845d8266..066e22b01a94 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -539,8 +539,7 @@ rx_status_loop: | |||
539 | unsigned buflen; | 539 | unsigned buflen; |
540 | 540 | ||
541 | skb = cp->rx_skb[rx_tail].skb; | 541 | skb = cp->rx_skb[rx_tail].skb; |
542 | if (!skb) | 542 | BUG_ON(!skb); |
543 | BUG(); | ||
544 | 543 | ||
545 | desc = &cp->rx_ring[rx_tail]; | 544 | desc = &cp->rx_ring[rx_tail]; |
546 | status = le32_to_cpu(desc->opts1); | 545 | status = le32_to_cpu(desc->opts1); |
@@ -723,8 +722,7 @@ static void cp_tx (struct cp_private *cp) | |||
723 | break; | 722 | break; |
724 | 723 | ||
725 | skb = cp->tx_skb[tx_tail].skb; | 724 | skb = cp->tx_skb[tx_tail].skb; |
726 | if (!skb) | 725 | BUG_ON(!skb); |
727 | BUG(); | ||
728 | 726 | ||
729 | pci_unmap_single(cp->pdev, cp->tx_skb[tx_tail].mapping, | 727 | pci_unmap_single(cp->pdev, cp->tx_skb[tx_tail].mapping, |
730 | cp->tx_skb[tx_tail].len, PCI_DMA_TODEVICE); | 728 | cp->tx_skb[tx_tail].len, PCI_DMA_TODEVICE); |
@@ -1550,8 +1548,7 @@ static void cp_get_ethtool_stats (struct net_device *dev, | |||
1550 | tmp_stats[i++] = le16_to_cpu(nic_stats->tx_abort); | 1548 | tmp_stats[i++] = le16_to_cpu(nic_stats->tx_abort); |
1551 | tmp_stats[i++] = le16_to_cpu(nic_stats->tx_underrun); | 1549 | tmp_stats[i++] = le16_to_cpu(nic_stats->tx_underrun); |
1552 | tmp_stats[i++] = cp->cp_stats.rx_frags; | 1550 | tmp_stats[i++] = cp->cp_stats.rx_frags; |
1553 | if (i != CP_NUM_STATS) | 1551 | BUG_ON(i != CP_NUM_STATS); |
1554 | BUG(); | ||
1555 | 1552 | ||
1556 | pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma); | 1553 | pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma); |
1557 | } | 1554 | } |
@@ -1856,8 +1853,7 @@ static void cp_remove_one (struct pci_dev *pdev) | |||
1856 | struct net_device *dev = pci_get_drvdata(pdev); | 1853 | struct net_device *dev = pci_get_drvdata(pdev); |
1857 | struct cp_private *cp = netdev_priv(dev); | 1854 | struct cp_private *cp = netdev_priv(dev); |
1858 | 1855 | ||
1859 | if (!dev) | 1856 | BUG_ON(!dev); |
1860 | BUG(); | ||
1861 | unregister_netdev(dev); | 1857 | unregister_netdev(dev); |
1862 | iounmap(cp->regs); | 1858 | iounmap(cp->regs); |
1863 | if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0); | 1859 | if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0); |