tracing: remove the unused value assignment in test_create_synth_event
PATCH 1/1 tracing: remove the unused value assignment in test_create_synth_event
From: Kaixu Xia <[email protected]>
The value of variable ret is overwritten on the delete branch in the test_create_synth_event(), so here the value assignment is useless. Remove it.
Reported-by Tosk Robot <[email protected]>
Signed-off-by Kaixu Xia <[email protected]>
--- kernel/trace/synth_event_gen_test.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
kernel/trace/synth_event_gen_test.c +1 -3
@@ -276,10 +276,8 @@ static int __init test_create_synth_event(void)*/ create_synth_test =trace_get_event_file (NULL ,"synthetic" ,"create_synth_test" ); -if (IS_ERR (create_synth_test)) { - ret =PTR_ERR (create_synth_test); +if (IS_ERR (create_synth_test)) goto delete; - }/* Enable the event or you won't see anything */ ret = trace_array_set_clr_event(create_synth_test->tr,
Signature · 1 line
2.20.0
Steven Rostedt
maintainerQuoted 6 lines · On Fri, 13 Nov 2020 15:33:30 +0800 [email protected] wrote:
From: Kaixu Xia <[email protected]>
The value of variable ret is overwritten on the delete branch in the
test_create_synth_event(), so here the value assignment is useless. Remove it.
No. The correct fix is to remove the useless assignment of ret in the delete portion. We care more about this error than we do about errors happening in cleaning up the breakage.
-- Steve
Quoted 22 lines
Reported-by Tosk Robot <[email protected]>Signed-off-by Kaixu Xia <[email protected]>--- kernel/trace/synth_event_gen_test.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)kernel/trace/synth_event_gen_test.c +1
-3@@ -276,10 +276,8 @@ static int __init test_create_synth_event(void)*/ create_synth_test =trace_get_event_file (NULL ,"synthetic" ,"create_synth_test" ); -if (IS_ERR (create_synth_test)) { - ret =PTR_ERR (create_synth_test); +if (IS_ERR (create_synth_test)) goto delete; - }/* Enable the event or you won't see anything */ ret = trace_array_set_clr_event(create_synth_test->tr,