Skip to contentSkip to conversation

BUG_ON() Conversion in fs/configfs/

PATCH New Eric Sesterhenn / snakebyte 1 participant 1 message Jan 27, 2006

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

PATCH 2/12 BUG_ON() Conversion in fs/configfs/

hi,

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

fs/configfs/inode.c renamed from fs/configfs/inode.c.orig +1 -2
@@ -105,8 +105,7 @@ const unsigned char * configfs_get_name(
 {
 	struct attribute * attr;
 
-	if (!sd || !sd->s_element)
-		BUG();
+	BUG_ON(!sd || !sd->s_element);
 
 	/* These always have a dentry, so use that */
 	if (sd->s_type & (CONFIGFS_DIR | CONFIGFS_ITEM_LINK))
fs/configfs/symlink.c renamed from fs/configfs/symlink.c.orig +1 -2
@@ -162,8 +162,7 @@ int configfs_unlink(struct inode *dir, s
 	if (!(sd->s_type & CONFIGFS_ITEM_LINK))
 		goto out;
 
-	if (dentry->d_parent == configfs_sb->s_root)
-		BUG();
+	BUG_ON(dentry->d_parent == configfs_sb->s_root);
 
 	sl = sd->s_element;
 

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