diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2012-11-08 15:23:04 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-11-08 16:42:02 -0500 |
commit | 8166ea07cb89208f6beb9aa6aed554250f150cc8 (patch) | |
tree | 61819564104958cdb33a1130360b832600d6746b | |
parent | 926ccfef82413623ae0e5c3a32d0cad2b9f33e96 (diff) |
alpha: use BUG_ON where possible
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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | arch/alpha/kernel/pci_iommu.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 3f844d26d2c7..a21d0ab3b19e 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -354,8 +354,7 @@ static dma_addr_t alpha_pci_map_page(struct device *dev, struct page *page, | |||
354 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | 354 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); |
355 | int dac_allowed; | 355 | int dac_allowed; |
356 | 356 | ||
357 | if (dir == PCI_DMA_NONE) | 357 | BUG_ON(dir == PCI_DMA_NONE); |
358 | BUG(); | ||
359 | 358 | ||
360 | dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; | 359 | dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; |
361 | return pci_map_single_1(pdev, (char *)page_address(page) + offset, | 360 | return pci_map_single_1(pdev, (char *)page_address(page) + offset, |
@@ -378,8 +377,7 @@ static void alpha_pci_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
378 | struct pci_iommu_arena *arena; | 377 | struct pci_iommu_arena *arena; |
379 | long dma_ofs, npages; | 378 | long dma_ofs, npages; |
380 | 379 | ||
381 | if (dir == PCI_DMA_NONE) | 380 | BUG_ON(dir == PCI_DMA_NONE); |
382 | BUG(); | ||
383 | 381 | ||
384 | if (dma_addr >= __direct_map_base | 382 | if (dma_addr >= __direct_map_base |
385 | && dma_addr < __direct_map_base + __direct_map_size) { | 383 | && dma_addr < __direct_map_base + __direct_map_size) { |
@@ -662,8 +660,7 @@ static int alpha_pci_map_sg(struct device *dev, struct scatterlist *sg, | |||
662 | dma_addr_t max_dma; | 660 | dma_addr_t max_dma; |
663 | int dac_allowed; | 661 | int dac_allowed; |
664 | 662 | ||
665 | if (dir == PCI_DMA_NONE) | 663 | BUG_ON(dir == PCI_DMA_NONE); |
666 | BUG(); | ||
667 | 664 | ||
668 | dac_allowed = dev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; | 665 | dac_allowed = dev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; |
669 | 666 | ||
@@ -742,8 +739,7 @@ static void alpha_pci_unmap_sg(struct device *dev, struct scatterlist *sg, | |||
742 | dma_addr_t max_dma; | 739 | dma_addr_t max_dma; |
743 | dma_addr_t fbeg, fend; | 740 | dma_addr_t fbeg, fend; |
744 | 741 | ||
745 | if (dir == PCI_DMA_NONE) | 742 | BUG_ON(dir == PCI_DMA_NONE); |
746 | BUG(); | ||
747 | 743 | ||
748 | if (! alpha_mv.mv_pci_tbi) | 744 | if (! alpha_mv.mv_pci_tbi) |
749 | return; | 745 | return; |