Skip to contentSkip to conversation

staging: lustre: lustre: libcfs: Remove unneeded NULL check

PATCH Superseded Janani Ravichandran 2 participants 2 messages Feb 21, 2016 – Feb 26, 2016 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: lustre: libcfs: Remove unneeded NULL check

Remove NULL check before debugfs_remove_recursive as it is not needed.
Generated-by: scripts/coccinelle/free/ifnullfree.cocci

---
 drivers/staging/lustre/lustre/libcfs/module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/libcfs/module.c +1 -2
index 611607a..a2723a6 100644
@@ -559,8 +559,7 @@ EXPORT_SYMBOL_GPL(lustre_insert_debugfs);
 
 static void lustre_remove_debugfs(void)
 {
-	if (lnet_debugfs_root != NULL)
-		debugfs_remove_recursive(lnet_debugfs_root);
+	debugfs_remove_recursive(lnet_debugfs_root);
 
 	lnet_debugfs_root = NULL;
 }
Signature · 1 line
2.5.0
maintainer
#1 lore raw
Quoted 13 lines · Janani Ravichandran

Remove NULL check before debugfs_remove_recursive as it is not needed.
Generated-by: scripts/coccinelle/free/ifnullfree.cocci

---
 drivers/staging/lustre/lustre/libcfs/module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/libcfs/module.c +0 -0
index 611607a..a2723a6 100644

drivers/staging/lustre/lustre/libcfs/module.c EXPORT_SYMBOL_GPL(lustre_insert_debugfs); · line 565

Quoted 9 lines
drivers/staging/lustre/lustre/libcfs/module.c +1 -2
@@ -559,8 +559,7 @@ EXPORT_SYMBOL_GPL(lustre_insert_debugfs);
 
 static void lustre_remove_debugfs(void)
 {
-	if (lnet_debugfs_root != NULL)
-		debugfs_remove_recursive(lnet_debugfs_root);
+	debugfs_remove_recursive(lnet_debugfs_root);
 
 	lnet_debugfs_root = NULL;
 }

Didn't someone already send this in? This doesn't apply :(