From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752415AbcFZKyJ (ORCPT ); Sun, 26 Jun 2016 06:54:09 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51010 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbcFZKyH (ORCPT ); Sun, 26 Jun 2016 06:54:07 -0400 Date: Sun, 26 Jun 2016 03:53:57 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: a.p.zijlstra@chello.nl, hpa@zytor.com, jolsa@redhat.com, adrian.hunter@intel.com, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org Reply-To: hpa@zytor.com, a.p.zijlstra@chello.nl, jolsa@redhat.com, acme@redhat.com, adrian.hunter@intel.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tests time-to-tsc: No need to disable an event before deleting it Git-Commit-ID: 61b3f66a3f99bb8a6a5145b1c2bd7eb98bf64748 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 61b3f66a3f99bb8a6a5145b1c2bd7eb98bf64748 Gitweb: http://git.kernel.org/tip/61b3f66a3f99bb8a6a5145b1c2bd7eb98bf64748 Author: Arnaldo Carvalho de Melo AuthorDate: Wed, 22 Jun 2016 10:10:52 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 22 Jun 2016 10:10:52 -0300 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 --- tools/perf/arch/x86/tests/perf-time-to-tsc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 d4aa567..5c76cc8 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; }