Skip to contentSkip to conversation

trace: no need to check return value of debugfs_create functions

PATCH New Greg Kroah-Hartman 1 participant 1 message Jan 22, 2019 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this.

Cc Steven Rostedt <[email protected]>
Cc Ingo Molnar <[email protected]>
---
 kernel/trace/trace.c | 4 ----
 1 file changed, 4 deletions(-)
kernel/trace/trace.c +0 -4
index c521b7347482..629bbb45279a 100644
@@ -8107,10 +8107,6 @@ struct dentry *tracing_init_dentry(void)
 	 */
 	tr->dir = debugfs_create_automount("tracing", NULL,
 					   trace_automount, NULL);
-	if (!tr->dir) {
-		pr_warn_once("Could not create debugfs directory 'tracing'\n");
-		return ERR_PTR(-ENOMEM);
-	}
 
 	return NULL;
 }
Signature · 1 line
2.20.1