diff options
author | Helge Deller <deller@gmx.de> | 2009-01-06 06:57:01 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@treachery.i.cabal.ca> | 2009-03-13 01:16:35 -0400 |
commit | 8980a7baf93e478205e32ec7d6ef3bfb6c0bdfa7 (patch) | |
tree | d70fd28dffc27959531d899a8c58954403f90358 /arch/parisc | |
parent | 041b62374c7fedc11a8a1eeda2868612d3d1436c (diff) |
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: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/kernel/cache.c | 5 | ||||
-rw-r--r-- | arch/parisc/kernel/pci-dma.c | 22 | ||||
-rw-r--r-- | arch/parisc/mm/init.c | 6 |
3 files changed, 9 insertions, 24 deletions
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index 5259d8c20676..837530ea32e7 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
@@ -551,10 +551,7 @@ void flush_cache_range(struct vm_area_struct *vma, | |||
551 | { | 551 | { |
552 | int sr3; | 552 | int sr3; |
553 | 553 | ||
554 | if (!vma->vm_mm->context) { | 554 | BUG_ON(!vma->vm_mm->context); |
555 | BUG(); | ||
556 | return; | ||
557 | } | ||
558 | 555 | ||
559 | sr3 = mfsp(3); | 556 | sr3 = mfsp(3); |
560 | if (vma->vm_mm->context == sr3) { | 557 | if (vma->vm_mm->context == sr3) { |
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index df47895db828..7d927eac932b 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c | |||
@@ -447,10 +447,7 @@ static void pa11_dma_free_consistent (struct device *dev, size_t size, void *vad | |||
447 | 447 | ||
448 | static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction direction) | 448 | static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction direction) |
449 | { | 449 | { |
450 | if (direction == DMA_NONE) { | 450 | BUG_ON(direction == DMA_NONE); |
451 | printk(KERN_ERR "pa11_dma_map_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0)); | ||
452 | BUG(); | ||
453 | } | ||
454 | 451 | ||
455 | flush_kernel_dcache_range((unsigned long) addr, size); | 452 | flush_kernel_dcache_range((unsigned long) addr, size); |
456 | return virt_to_phys(addr); | 453 | 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 | 455 | ||
459 | static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) | 456 | static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) |
460 | { | 457 | { |
461 | if (direction == DMA_NONE) { | 458 | BUG_ON(direction == DMA_NONE); |
462 | printk(KERN_ERR "pa11_dma_unmap_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0)); | ||
463 | BUG(); | ||
464 | } | ||
465 | 459 | ||
466 | if (direction == DMA_TO_DEVICE) | 460 | if (direction == DMA_TO_DEVICE) |
467 | return; | 461 | return; |
@@ -480,8 +474,7 @@ static int pa11_dma_map_sg(struct device *dev, struct scatterlist *sglist, int n | |||
480 | { | 474 | { |
481 | int i; | 475 | int i; |
482 | 476 | ||
483 | if (direction == DMA_NONE) | 477 | BUG_ON(direction == DMA_NONE); |
484 | BUG(); | ||
485 | 478 | ||
486 | for (i = 0; i < nents; i++, sglist++ ) { | 479 | for (i = 0; i < nents; i++, sglist++ ) { |
487 | unsigned long vaddr = sg_virt_addr(sglist); | 480 | 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 | { | 489 | { |
497 | int i; | 490 | int i; |
498 | 491 | ||
499 | if (direction == DMA_NONE) | 492 | BUG_ON(direction == DMA_NONE); |
500 | BUG(); | ||
501 | 493 | ||
502 | if (direction == DMA_TO_DEVICE) | 494 | if (direction == DMA_TO_DEVICE) |
503 | return; | 495 | return; |
@@ -511,16 +503,14 @@ static void pa11_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, in | |||
511 | 503 | ||
512 | 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) | 504 | 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) |
513 | { | 505 | { |
514 | if (direction == DMA_NONE) | 506 | BUG_ON(direction == DMA_NONE); |
515 | BUG(); | ||
516 | 507 | ||
517 | flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); | 508 | flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); |
518 | } | 509 | } |
519 | 510 | ||
520 | 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) | 511 | 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) |
521 | { | 512 | { |
522 | if (direction == DMA_NONE) | 513 | BUG_ON(direction == DMA_NONE); |
523 | BUG(); | ||
524 | 514 | ||
525 | flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); | 515 | flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); |
526 | } | 516 | } |
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 7c155c254e72..9d704d9831d1 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c | |||
@@ -304,10 +304,8 @@ static void __init setup_bootmem(void) | |||
304 | */ | 304 | */ |
305 | max_low_pfn = max_pfn; | 305 | max_low_pfn = max_pfn; |
306 | 306 | ||
307 | if ((bootmap_pfn - bootmap_start_pfn) != bootmap_pages) { | 307 | /* bootmap sizing messed up? */ |
308 | printk(KERN_WARNING "WARNING! bootmap sizing is messed up!\n"); | 308 | BUG_ON((bootmap_pfn - bootmap_start_pfn) != bootmap_pages); |
309 | BUG(); | ||
310 | } | ||
311 | 309 | ||
312 | /* reserve PAGE0 pdc memory, kernel text/data/bss & bootmap */ | 310 | /* reserve PAGE0 pdc memory, kernel text/data/bss & bootmap */ |
313 | 311 | ||