parisc: BUG_ON() cleanup
authorHelge Deller <deller@gmx.de>
Tue, 6 Jan 2009 11:57:01 +0000 (12:57 +0100)
committerKyle McMartin <kyle@treachery.i.cabal.ca>
Fri, 13 Mar 2009 05:16:35 +0000 (01:16 -0400)
- convert a few "if (xx) BUG();" to BUG_ON(xx)
- remove a few printk()s, as we get a backtrace with BUG_ON() anyway

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
arch/parisc/kernel/cache.c
arch/parisc/kernel/pci-dma.c
arch/parisc/mm/init.c

index 5259d8c20676f49282ad9c1439e18d19072b0574..837530ea32e783e6671ce2793bf08f30424b6808 100644 (file)
@@ -551,10 +551,7 @@ void flush_cache_range(struct vm_area_struct *vma,
 {
        int sr3;
 
-       if (!vma->vm_mm->context) {
-               BUG();
-               return;
-       }
+       BUG_ON(!vma->vm_mm->context);
 
        sr3 = mfsp(3);
        if (vma->vm_mm->context == sr3) {
index df47895db8287e0d520a1575e5a3aeda672e5412..7d927eac932b9ccf598bc710bba8e965b2bcd539 100644 (file)
@@ -447,10 +447,7 @@ static void pa11_dma_free_consistent (struct device *dev, size_t size, void *vad
 
 static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction direction)
 {
-       if (direction == DMA_NONE) {
-               printk(KERN_ERR "pa11_dma_map_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0));
-               BUG();
-       }
+       BUG_ON(direction == DMA_NONE);
 
        flush_kernel_dcache_range((unsigned long) addr, size);
        return virt_to_phys(addr);
@@ -458,10 +455,7 @@ static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t siz
 
 static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
 {
-       if (direction == DMA_NONE) {
-               printk(KERN_ERR "pa11_dma_unmap_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0));
-               BUG();
-       }
+       BUG_ON(direction == DMA_NONE);
 
        if (direction == DMA_TO_DEVICE)
            return;
@@ -480,8 +474,7 @@ static int pa11_dma_map_sg(struct device *dev, struct scatterlist *sglist, int n
 {
        int i;
 
-       if (direction == DMA_NONE)
-           BUG();
+       BUG_ON(direction == DMA_NONE);
 
        for (i = 0; i < nents; i++, sglist++ ) {
                unsigned long vaddr = sg_virt_addr(sglist);
@@ -496,8 +489,7 @@ static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, in
 {
        int i;
 
-       if (direction == DMA_NONE)
-           BUG();
+       BUG_ON(direction == DMA_NONE);
 
        if (direction == DMA_TO_DEVICE)
            return;
@@ -511,16 +503,14 @@ static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, in
 
 static void pa11_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction)
 {
-       if (direction == DMA_NONE)
-           BUG();
+       BUG_ON(direction == DMA_NONE);
 
        flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size);
 }
 
 static void pa11_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction)
 {
-       if (direction == DMA_NONE)
-           BUG();
+       BUG_ON(direction == DMA_NONE);
 
        flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size);
 }
index 7c155c254e72f82cf0dee7d54012de286441fa0b..9d704d9831d1612a84eb3a82c6e94bf17041ad7d 100644 (file)
@@ -304,10 +304,8 @@ static void __init setup_bootmem(void)
         */
        max_low_pfn = max_pfn;
 
-       if ((bootmap_pfn - bootmap_start_pfn) != bootmap_pages) {
-               printk(KERN_WARNING "WARNING! bootmap sizing is messed up!\n");
-               BUG();
-       }
+       /* bootmap sizing messed up? */
+       BUG_ON((bootmap_pfn - bootmap_start_pfn) != bootmap_pages);
 
        /* reserve PAGE0 pdc memory, kernel text/data/bss & bootmap */