tracing: make tracing_init_dentry() returns an integer instead of a d_entry pointer

Current tracing_init_dentry() return a d_entry pointer, while is not
necessary. This function returns NULL on success or error on failure,
which means there is no valid d_entry pointer return.

Let's return 0 on success and negative value for error.

Link: https://lkml.kernel.org/r/20200712011036.70948-5-richard.weiyang@linux.alibaba.com

Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Wei Yang
2020-07-12 09:10:36 +08:00
committed by Steven Rostedt (VMware)
parent dc300d77b8
commit 22c36b1826
11 changed files with 57 additions and 61 deletions

View File

@@ -276,13 +276,13 @@ static const struct file_operations tracing_stat_fops = {
static int tracing_stat_init(void)
{
struct dentry *d_tracing;
int ret;
d_tracing = tracing_init_dentry();
if (IS_ERR(d_tracing))
ret = tracing_init_dentry();
if (ret)
return -ENODEV;
stat_dir = tracefs_create_dir("trace_stat", d_tracing);
stat_dir = tracefs_create_dir("trace_stat", NULL);
if (!stat_dir) {
pr_warn("Could not create tracefs 'trace_stat' entry\n");
return -ENOMEM;