Skip to content

Commit

Permalink
dma-fence: Don't BUG_ON when not absolutely needed
Browse files Browse the repository at this point in the history
It makes debugging a massive pain.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Sumit Semwal <sumit.semwal@linaro.org>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170720125107.26693-1-daniel.vetter@ffwll.ch
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Jul 26, 2017
1 parent 4bf9914 commit 6ce3126
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/dma-buf/dma-fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(0);
*/
u64 dma_fence_context_alloc(unsigned num)
{
BUG_ON(!num);
WARN_ON(!num);
return atomic64_add_return(num, &dma_fence_context_counter) - num;
}
EXPORT_SYMBOL(dma_fence_context_alloc);
Expand Down Expand Up @@ -177,7 +177,7 @@ void dma_fence_release(struct kref *kref)

trace_dma_fence_destroy(fence);

BUG_ON(!list_empty(&fence->cb_list));
WARN_ON(!list_empty(&fence->cb_list));

if (fence->ops->release)
fence->ops->release(fence);
Expand Down
4 changes: 2 additions & 2 deletions include/linux/dma-fence.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ int dma_fence_get_status(struct dma_fence *fence);
static inline void dma_fence_set_error(struct dma_fence *fence,
int error)
{
BUG_ON(test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags));
BUG_ON(error >= 0 || error < -MAX_ERRNO);
WARN_ON(test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags));
WARN_ON(error >= 0 || error < -MAX_ERRNO);

fence->error = error;
}
Expand Down

0 comments on commit 6ce3126

Please sign in to comment.