Commit 8980a7ba authored by Helge Deller's avatar Helge Deller Committed by Kyle McMartin

parisc: BUG_ON() cleanup

- 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: default avatarHelge Deller <deller@gmx.de>
Signed-off-by: default avatarKyle McMartin <kyle@mcmartin.ca>
parent 041b6237
...@@ -551,10 +551,7 @@ void flush_cache_range(struct vm_area_struct *vma, ...@@ -551,10 +551,7 @@ void flush_cache_range(struct vm_area_struct *vma,
{ {
int sr3; int sr3;
if (!vma->vm_mm->context) { BUG_ON(!vma->vm_mm->context);
BUG();
return;
}
sr3 = mfsp(3); sr3 = mfsp(3);
if (vma->vm_mm->context == sr3) { if (vma->vm_mm->context == sr3) {
......
...@@ -447,10 +447,7 @@ static void pa11_dma_free_consistent (struct device *dev, size_t size, void *vad ...@@ -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) 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) { BUG_ON(direction == DMA_NONE);
printk(KERN_ERR "pa11_dma_map_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0));
BUG();
}
flush_kernel_dcache_range((unsigned long) addr, size); flush_kernel_dcache_range((unsigned long) addr, size);
return virt_to_phys(addr); 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 ...@@ -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) 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) { BUG_ON(direction == DMA_NONE);
printk(KERN_ERR "pa11_dma_unmap_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0));
BUG();
}
if (direction == DMA_TO_DEVICE) if (direction == DMA_TO_DEVICE)
return; return;
...@@ -480,8 +474,7 @@ static int pa11_dma_map_sg(struct device *dev, struct scatterlist *sglist, int n ...@@ -480,8 +474,7 @@ static int pa11_dma_map_sg(struct device *dev, struct scatterlist *sglist, int n
{ {
int i; int i;
if (direction == DMA_NONE) BUG_ON(direction == DMA_NONE);
BUG();
for (i = 0; i < nents; i++, sglist++ ) { for (i = 0; i < nents; i++, sglist++ ) {
unsigned long vaddr = sg_virt_addr(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 ...@@ -496,8 +489,7 @@ static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, in
{ {
int i; int i;
if (direction == DMA_NONE) BUG_ON(direction == DMA_NONE);
BUG();
if (direction == DMA_TO_DEVICE) if (direction == DMA_TO_DEVICE)
return; return;
...@@ -511,16 +503,14 @@ static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, in ...@@ -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) 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_ON(direction == DMA_NONE);
BUG();
flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); 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) 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_ON(direction == DMA_NONE);
BUG();
flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size);
} }
......
...@@ -304,10 +304,8 @@ static void __init setup_bootmem(void) ...@@ -304,10 +304,8 @@ static void __init setup_bootmem(void)
*/ */
max_low_pfn = max_pfn; max_low_pfn = max_pfn;
if ((bootmap_pfn - bootmap_start_pfn) != bootmap_pages) { /* bootmap sizing messed up? */
printk(KERN_WARNING "WARNING! bootmap sizing is messed up!\n"); BUG_ON((bootmap_pfn - bootmap_start_pfn) != bootmap_pages);
BUG();
}
/* reserve PAGE0 pdc memory, kernel text/data/bss & bootmap */ /* reserve PAGE0 pdc memory, kernel text/data/bss & bootmap */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment