Skip to contentSkip to conversation

BUG_ON() Conversion in md/raid1.c

PATCH In review Eric Sesterhenn / snakebyte 1 participant 1 message Jan 26, 2006

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

PATCH 6/9 BUG_ON() Conversion in md/raid1.c

hi,

this changes if() BUG(); constructs to BUG_ON() which is cleaner and can better optimized away

drivers/md/raid1.c renamed from drivers/md/raid1.c.orig +2 -4
@@ -1541,8 +1541,7 @@ static int init_resync(conf_t *conf)
 	int buffs;
 
 	buffs = RESYNC_WINDOW / RESYNC_BLOCK_SIZE;
-	if (conf->r1buf_pool)
-		BUG();
+	BUG_ON(conf->r1buf_pool);
 	conf->r1buf_pool = mempool_create(buffs, r1buf_pool_alloc, r1buf_pool_free,
 					  conf->poolinfo);
 	if (!conf->r1buf_pool)
@@ -1715,8 +1714,7 @@ static sector_t sync_request(mddev_t *md
 			    !conf->fullsync &&
 			    !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
 				break;
-			if (sync_blocks < (PAGE_SIZE>>9))
-				BUG();
+			BUG_ON(sync_blocks < (PAGE_SIZE>>9));
 			if (len > (sync_blocks<<9))
 				len = sync_blocks<<9;
 		}

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