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:

committed by
Steven Rostedt (VMware)

parent
dc300d77b8
commit
22c36b1826
@@ -1757,7 +1757,6 @@ static const struct file_operations synth_events_fops = {
|
||||
static __init int trace_events_synth_init(void)
|
||||
{
|
||||
struct dentry *entry = NULL;
|
||||
struct dentry *d_tracer;
|
||||
int err = 0;
|
||||
|
||||
err = dyn_event_register(&synth_event_ops);
|
||||
@@ -1766,13 +1765,11 @@ static __init int trace_events_synth_init(void)
|
||||
return err;
|
||||
}
|
||||
|
||||
d_tracer = tracing_init_dentry();
|
||||
if (IS_ERR(d_tracer)) {
|
||||
err = PTR_ERR(d_tracer);
|
||||
err = tracing_init_dentry();
|
||||
if (err)
|
||||
goto err;
|
||||
}
|
||||
|
||||
entry = tracefs_create_file("synthetic_events", 0644, d_tracer,
|
||||
entry = tracefs_create_file("synthetic_events", 0644, NULL,
|
||||
NULL, &synth_events_fops);
|
||||
if (!entry) {
|
||||
err = -ENODEV;
|
||||
|
Reference in New Issue
Block a user