mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 06:04:23 +08:00
tracing/histograms: Simplify create_hist_fields()
When I look into implements of create_hist_fields(), I think there can be following two simplifications: 1. If something wrong happened in parse_var_defs(), free_var_defs() would have been called in it, so no need goto free again after calling it; 2. After calling create_key_fields(), regardless of the value of 'ret', it then always runs into 'out: ', so the judge of 'ret' is redundant. Link: https://lkml.kernel.org/r/20220630013152.164871-1-zhengyejian1@huawei.com Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com> Reviewed-by: Tom Rix <trix@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
parent
94c255ac67
commit
fb991f1942
@ -4455,7 +4455,7 @@ static int create_hist_fields(struct hist_trigger_data *hist_data,
|
|||||||
|
|
||||||
ret = parse_var_defs(hist_data);
|
ret = parse_var_defs(hist_data);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
return ret;
|
||||||
|
|
||||||
ret = create_val_fields(hist_data, file);
|
ret = create_val_fields(hist_data, file);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -4466,8 +4466,7 @@ static int create_hist_fields(struct hist_trigger_data *hist_data,
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = create_key_fields(hist_data, file);
|
ret = create_key_fields(hist_data, file);
|
||||||
if (ret)
|
|
||||||
goto out;
|
|
||||||
out:
|
out:
|
||||||
free_var_defs(hist_data);
|
free_var_defs(hist_data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user