Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Remove redundant assignment to event_var

Variable event_var is set to 'ERR_PTR(-EINVAL)', but this value
is never read as it is overwritten or not used later on, hence
it is a redundant assignment and can be removed.

Clean up the following clang-analyzer warning:

kernel/trace/trace_events_hist.c:2437:21: warning: Value stored to
'event_var' during its initialization is never read
[clang-analyzer-deadcode.DeadStores].

Link: https://lkml.kernel.org/r/1620470236-26562-1-git-send-email-jiapeng.chong@linux.alibaba.com

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

authored by

Jiapeng Chong and committed by
Steven Rostedt (VMware)
614db49c 58b9987d

+1 -1
+1 -1
kernel/trace/trace_events_hist.c
··· 2434 2434 char *subsys_name, char *event_name, char *field_name) 2435 2435 { 2436 2436 struct trace_array *tr = target_hist_data->event_file->tr; 2437 - struct hist_field *event_var = ERR_PTR(-EINVAL); 2438 2437 struct hist_trigger_data *hist_data; 2439 2438 unsigned int i, n, first = true; 2440 2439 struct field_var_hist *var_hist; 2441 2440 struct trace_event_file *file; 2442 2441 struct hist_field *key_field; 2442 + struct hist_field *event_var; 2443 2443 char *saved_filter; 2444 2444 char *cmd; 2445 2445 int ret;