Skip to content

Commit

Permalink
BUG_ON conversion for fs/aio.c
Browse files Browse the repository at this point in the history
This patch converts a if () BUG(); construct to BUG_ON();
which occupies less space, uses unlikely and is safer when
BUG() is disabled.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
  • Loading branch information
Eric Sesterhenn authored and Adrian Bunk committed Nov 30, 2006
1 parent d99c590 commit 93e06b4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,7 @@ void fastcall __put_ioctx(struct kioctx *ctx)
{
unsigned nr_events = ctx->max_reqs;

if (unlikely(ctx->reqs_active))
BUG();
BUG_ON(ctx->reqs_active);

cancel_delayed_work(&ctx->wq);
flush_workqueue(aio_wq);
Expand Down Expand Up @@ -505,8 +504,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
assert_spin_locked(&ctx->ctx_lock);

req->ki_users --;
if (unlikely(req->ki_users < 0))
BUG();
BUG_ON(req->ki_users < 0);
if (likely(req->ki_users))
return 0;
list_del(&req->ki_list); /* remove from active_reqs */
Expand Down

0 comments on commit 93e06b4

Please sign in to comment.