Skip to content

Commit

Permalink
[PATCH] Use BUG_ON(foo) instead of "if (foo) BUG()" in include/asm-i3…
Browse files Browse the repository at this point in the history
…86/dma-mapping.h

Signed-off-by: Rolf Eike Beer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
DerDakon authored and Linus Torvalds committed Sep 26, 2006
1 parent 9932532 commit 3a75036
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions include/asm-i386/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ static inline dma_addr_t
dma_map_single(struct device *dev, void *ptr, size_t size,
enum dma_data_direction direction)
{
if (direction == DMA_NONE)
BUG();
BUG_ON(direction == DMA_NONE);
WARN_ON(size == 0);
flush_write_buffers();
return virt_to_phys(ptr);
Expand All @@ -32,8 +31,7 @@ static inline void
dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
enum dma_data_direction direction)
{
if (direction == DMA_NONE)
BUG();
BUG_ON(direction == DMA_NONE);
}

static inline int
Expand All @@ -42,8 +40,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
{
int i;

if (direction == DMA_NONE)
BUG();
BUG_ON(direction == DMA_NONE);
WARN_ON(nents == 0 || sg[0].length == 0);

for (i = 0; i < nents; i++ ) {
Expand Down

0 comments on commit 3a75036

Please sign in to comment.