Skip to content

Commit

Permalink
dma: use BUG_ON correctly in mv_xor.c, v4
Browse files Browse the repository at this point in the history
This patch makes BUG_ON() usage correct in drivers/dma/mv_xor.c

Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Coly Li <bosong.ly@taobao.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Coly Li authored and Vinod Koul committed Mar 31, 2011
1 parent e2ec771 commit 7912d30
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/dma/mv_xor.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ mv_xor_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
return NULL;

BUG_ON(unlikely(len > MV_XOR_MAX_BYTE_COUNT));
BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);

spin_lock_bh(&mv_chan->lock);
slot_cnt = mv_chan_memcpy_slot_count(len);
Expand Down Expand Up @@ -710,7 +710,7 @@ mv_xor_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
return NULL;

BUG_ON(unlikely(len > MV_XOR_MAX_BYTE_COUNT));
BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);

spin_lock_bh(&mv_chan->lock);
slot_cnt = mv_chan_memset_slot_count(len);
Expand Down Expand Up @@ -744,7 +744,7 @@ mv_xor_prep_dma_xor(struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
return NULL;

BUG_ON(unlikely(len > MV_XOR_MAX_BYTE_COUNT));
BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);

dev_dbg(mv_chan->device->common.dev,
"%s src_cnt: %d len: dest %x %u flags: %ld\n",
Expand Down

0 comments on commit 7912d30

Please sign in to comment.