Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Helge Deller and committed by
Kyle McMartin
8980a7ba 041b6237

+9 -24
+1 -4
arch/parisc/kernel/cache.c
··· 551 551 { 552 552 int sr3; 553 553 554 - if (!vma->vm_mm->context) { 555 - BUG(); 556 - return; 557 - } 554 + BUG_ON(!vma->vm_mm->context); 558 555 559 556 sr3 = mfsp(3); 560 557 if (vma->vm_mm->context == sr3) {
+6 -16
arch/parisc/kernel/pci-dma.c
··· 447 447 448 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) { 451 - printk(KERN_ERR "pa11_dma_map_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0)); 452 - BUG(); 453 - } 450 + BUG_ON(direction == DMA_NONE); 454 451 455 452 flush_kernel_dcache_range((unsigned long) addr, size); 456 453 return virt_to_phys(addr); ··· 455 458 456 459 static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) 457 460 { 458 - if (direction == DMA_NONE) { 459 - printk(KERN_ERR "pa11_dma_unmap_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0)); 460 - BUG(); 461 - } 461 + BUG_ON(direction == DMA_NONE); 462 462 463 463 if (direction == DMA_TO_DEVICE) 464 464 return; ··· 474 480 { 475 481 int i; 476 482 477 - if (direction == DMA_NONE) 478 - BUG(); 483 + BUG_ON(direction == DMA_NONE); 479 484 480 485 for (i = 0; i < nents; i++, sglist++ ) { 481 486 unsigned long vaddr = sg_virt_addr(sglist); ··· 489 496 { 490 497 int i; 491 498 492 - if (direction == DMA_NONE) 493 - BUG(); 499 + BUG_ON(direction == DMA_NONE); 494 500 495 501 if (direction == DMA_TO_DEVICE) 496 502 return; ··· 503 511 504 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) 505 513 { 506 - if (direction == DMA_NONE) 507 - BUG(); 514 + BUG_ON(direction == DMA_NONE); 508 515 509 516 flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); 510 517 } 511 518 512 519 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) 513 520 { 514 - if (direction == DMA_NONE) 515 - BUG(); 521 + BUG_ON(direction == DMA_NONE); 516 522 517 523 flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size); 518 524 }
+2 -4
arch/parisc/mm/init.c
··· 304 304 */ 305 305 max_low_pfn = max_pfn; 306 306 307 - if ((bootmap_pfn - bootmap_start_pfn) != bootmap_pages) { 308 - printk(KERN_WARNING "WARNING! bootmap sizing is messed up!\n"); 309 - BUG(); 310 - } 307 + /* bootmap sizing messed up? */ 308 + BUG_ON((bootmap_pfn - bootmap_start_pfn) != bootmap_pages); 311 309 312 310 /* reserve PAGE0 pdc memory, kernel text/data/bss & bootmap */ 313 311