Commit 3a750363 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Linus Torvalds

[PATCH] Use BUG_ON(foo) instead of "if (foo) BUG()" in include/asm-i386/dma-mapping.h

Signed-off-by: default avatarRolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 99325326
...@@ -21,8 +21,7 @@ static inline dma_addr_t ...@@ -21,8 +21,7 @@ static inline dma_addr_t
dma_map_single(struct device *dev, void *ptr, size_t size, dma_map_single(struct device *dev, void *ptr, size_t size,
enum dma_data_direction direction) enum dma_data_direction direction)
{ {
if (direction == DMA_NONE) BUG_ON(direction == DMA_NONE);
BUG();
WARN_ON(size == 0); WARN_ON(size == 0);
flush_write_buffers(); flush_write_buffers();
return virt_to_phys(ptr); return virt_to_phys(ptr);
...@@ -32,8 +31,7 @@ static inline void ...@@ -32,8 +31,7 @@ static inline void
dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
enum dma_data_direction direction) enum dma_data_direction direction)
{ {
if (direction == DMA_NONE) BUG_ON(direction == DMA_NONE);
BUG();
} }
static inline int static inline int
...@@ -42,8 +40,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, ...@@ -42,8 +40,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
{ {
int i; int i;
if (direction == DMA_NONE) BUG_ON(direction == DMA_NONE);
BUG();
WARN_ON(nents == 0 || sg[0].length == 0); WARN_ON(nents == 0 || sg[0].length == 0);
for (i = 0; i < nents; i++ ) { for (i = 0; i < nents; i++ ) {
......
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