Skip to contentSkip to conversation

staging: lustre: lustre: obdclass: Remove unneeded NULL check

PATCH In review Janani Ravichandran 2 participants 2 messages Feb 21, 2016 Staging

lore
Share & tools
lore
#0 lore raw

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

Remove unneeded NULL check before debugfs_remove_recursive. Coccinelle script used can be found at 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;
 
Signature · 1 line
2.5.0
#1 lore raw
Quoted 3 lines · Janani Ravichandran

Remove unneeded NULL check before debugfs_remove_recursive. Coccinelle script used can be found at scripts/coccinelle/free/ifnullfree.cocci

This should be Generated-by: scripts/coccinelle/free/ifnullfree.cocci

when the script is part of the kernel.

But I have the impression that I have seen this patch before.

julia

Quoted 30 lines
---
 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 -3
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.5.0

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160221193348.GA28437%40janani-Inspiron-3521.
For more options, visit https://groups.google.com/d/optout.