[PATCH 18/25] [xtensa] BUG to BUG_ON changes

From: Stoyan Gaydarov
Date: Tue Mar 10 2009 - 01:17:40 EST


Signed-off-by: Stoyan Gaydarov <stoyboyker@xxxxxxxxx>
---
arch/xtensa/kernel/pci-dma.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/xtensa/kernel/pci-dma.c b/arch/xtensa/kernel/pci-dma.c
index f5319d7..3677bd0 100644
--- a/arch/xtensa/kernel/pci-dma.c
+++ b/arch/xtensa/kernel/pci-dma.c
@@ -47,10 +47,8 @@ dma_alloc_coherent(struct device *dev,size_t size,dma_addr_t *handle,gfp_t flag)

/* We currently don't support coherent memory outside KSEG */

- if (ret < XCHAL_KSEG_CACHED_VADDR
- || ret >= XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE)
- BUG();
-
+ BUG_ON(ret < XCHAL_KSEG_CACHED_VADDR
+ || ret >= XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_SIZE);

if (ret != 0) {
memset((void*) ret, 0, size);
@@ -67,8 +65,7 @@ void dma_free_coherent(struct device *hwdev, size_t size,
{
long addr=(long)vaddr+XCHAL_KSEG_CACHED_VADDR-XCHAL_KSEG_BYPASS_VADDR;

- if (addr < 0 || addr >= XCHAL_KSEG_SIZE)
- BUG();
+ BUG_ON(addr < 0 || addr >= XCHAL_KSEG_SIZE);

free_pages(addr, get_order(size));
}
--
1.6.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/