Skip to contentSkip to conversation

BUG_ON conversion for fs/aio.c

PATCH New Eric Sesterhenn 1 participant 1 message Sep 18, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 BUG_ON conversion for fs/aio.c

hi,

this patch converts a if () BUG(); construct to BUG_ON(); which occupies less space, uses unlikely and is safer when BUG() is disabled.

fs/aio.c renamed from fs/aio.c.orig +2 -4
@@ -366,8 +366,7 @@ void fastcall __put_ioctx(struct kioctx 
 {
 	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);
@@ -501,8 +500,7 @@ static int __aio_put_req(struct kioctx *
 	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 */

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors