Skip to contentSkip to conversation

BUG_ON() Conversion in md/dm-table.c

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

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

PATCH 4/9 BUG_ON() Conversion in md/dm-table.c

hi,

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

drivers/md/dm-table.c renamed from drivers/md/dm-table.c.orig +2 -4
@@ -352,8 +352,7 @@ static int open_dev(struct dm_dev *d, de
 
 	int r;
 
-	if (d->bdev)
-		BUG();
+	BUG_ON(d->bdev);
 
 	bdev = open_by_devnum(dev, d->mode);
 	if (IS_ERR(bdev))
@@ -427,8 +426,7 @@ static int __table_get_device(struct dm_
 	struct dm_dev *dd;
 	unsigned int major, minor;
 
-	if (!t)
-		BUG();
+	BUG_ON(!t);
 
 	if (sscanf(path, "%u:%u", &major, &minor) == 2) {
 		/* Extract the major/minor numbers */

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