Skip to contentSkip to conversation

staging: lusture: obdclass: Remove unnecessary NULL check

PATCH In review Bhaktipriya Shridhar 2 participants 2 messages Feb 18, 2016 – Feb 20, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lusture: obdclass: Remove unnecessary NULL check

NULL check before the debugfs_remove_recursive function is not needed.

This was detected using scripts/coccinelle/free/ifnullfree.cocci

---
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +1 -2
index 1913f3e..2045621 100644
@@ -454,8 +454,7 @@ out:
 
 int class_procfs_clean(void)
 {
-	if (debugfs_lustre_root != NULL)
-		debugfs_remove_recursive(debugfs_lustre_root);
+	debugfs_remove_recursive(debugfs_lustre_root);
 
 	debugfs_lustre_root = NULL;
 

--
2.1.4

#1 lore raw
Quoted 8 lines · Bhaktipriya Shridhar

NULL check before the debugfs_remove_recursive function is not needed.

This was detected using scripts/coccinelle/free/ifnullfree.cocci

---
 drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Doesn't apply to my tree :(