Commit 026bb845 authored by Kaitao Cheng's avatar Kaitao Cheng Committed by Steven Rostedt (VMware)

ftrace: Fix maybe-uninitialized compiler warning

During build compiler reports some 'false positive' warnings about
variables {'seq_ops', 'filtered_pids', 'other_pids'} may be used
uninitialized. This patch silences these warnings.
Also delete some useless spaces

Link: https://lkml.kernel.org/r/20200529141214.37648-1-pilgrimtao@gmail.comSigned-off-by: default avatarKaitao Cheng <pilgrimtao@gmail.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 5414251a
...@@ -2260,7 +2260,7 @@ ftrace_find_tramp_ops_next(struct dyn_ftrace *rec, ...@@ -2260,7 +2260,7 @@ ftrace_find_tramp_ops_next(struct dyn_ftrace *rec,
if (hash_contains_ip(ip, op->func_hash)) if (hash_contains_ip(ip, op->func_hash))
return op; return op;
} }
return NULL; return NULL;
} }
...@@ -3599,7 +3599,7 @@ static int t_show(struct seq_file *m, void *v) ...@@ -3599,7 +3599,7 @@ static int t_show(struct seq_file *m, void *v)
if (direct) if (direct)
seq_printf(m, "\n\tdirect-->%pS", (void *)direct); seq_printf(m, "\n\tdirect-->%pS", (void *)direct);
} }
} }
seq_putc(m, '\n'); seq_putc(m, '\n');
...@@ -7151,6 +7151,10 @@ static int pid_open(struct inode *inode, struct file *file, int type) ...@@ -7151,6 +7151,10 @@ static int pid_open(struct inode *inode, struct file *file, int type)
case TRACE_NO_PIDS: case TRACE_NO_PIDS:
seq_ops = &ftrace_no_pid_sops; seq_ops = &ftrace_no_pid_sops;
break; break;
default:
trace_array_put(tr);
WARN_ON_ONCE(1);
return -EINVAL;
} }
ret = seq_open(file, seq_ops); ret = seq_open(file, seq_ops);
...@@ -7229,6 +7233,10 @@ pid_write(struct file *filp, const char __user *ubuf, ...@@ -7229,6 +7233,10 @@ pid_write(struct file *filp, const char __user *ubuf,
other_pids = rcu_dereference_protected(tr->function_pids, other_pids = rcu_dereference_protected(tr->function_pids,
lockdep_is_held(&ftrace_lock)); lockdep_is_held(&ftrace_lock));
break; break;
default:
ret = -EINVAL;
WARN_ON_ONCE(1);
goto out;
} }
ret = trace_pid_write(filtered_pids, &pid_list, ubuf, cnt); ret = trace_pid_write(filtered_pids, &pid_list, ubuf, cnt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment