From: Arnaldo Carvalho de Melo Date: Wed, 22 Jun 2016 13:10:52 +0000 (-0300) Subject: perf tests time-to-tsc: No need to disable an event before deleting it X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=61b3f66a3f99bb8a6a5145b1c2bd7eb98bf64748;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git perf tests time-to-tsc: No need to disable an event before deleting it Because at the destructor we will call close() and that will do the disable. And we destructors can accept NULL, just like free(), so no need to check it. Cc: Adrian Hunter Cc: Peter Zijlstra Cc: Jiri Olsa Link: http://lkml.kernel.org/n/tip-i98mcyfkkjh5qp62dle27ac1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c index d4aa567a29c4..5c76cc83186a 100644 --- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c +++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c @@ -154,10 +154,6 @@ next_event: err = 0; out_err: - if (evlist) { - perf_evlist__disable(evlist); - perf_evlist__delete(evlist); - } - + perf_evlist__delete(evlist); return err; }