From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbdFALRy (ORCPT ); Thu, 1 Jun 2017 07:17:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52294 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751673AbdFALRv (ORCPT ); Thu, 1 Jun 2017 07:17:51 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DBFC380479 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=none smtp.mailfrom=jolsa@kernel.org DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DBFC380479 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , "Du, Changbin" Subject: [PATCH 2/2] perf tools: Remove extra list_del_init calls in list reset Date: Thu, 1 Jun 2017 13:17:44 +0200 Message-Id: <20170601111744.15580-2-jolsa@kernel.org> In-Reply-To: <20170601111744.15580-1-jolsa@kernel.org> References: <20170601111744.15580-1-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 01 Jun 2017 11:17:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We only needs to remove the format from the currently iterated list. The other removals/inits are superfluous because we free the format in any case. Link: http://lkml.kernel.org/n/tip-8umo89ntt3kawmfwsivav43t@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/ui/hist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index feb2174ddd1f..a0fee2ac8599 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -614,15 +614,15 @@ void perf_hpp__reset_output_field(struct perf_hpp_list *list) /* reset output fields */ perf_hpp_list__for_each_format_safe(list, fmt, tmp) { - list_del_init(&fmt->list); - list_del_init(&fmt->sort_list); + list_del(&fmt->list); + /* Remove the fmt from next loop processing. */ + list_del(&fmt->sort_list); fmt_free(fmt); } /* reset sort keys */ perf_hpp_list__for_each_sort_list_safe(list, fmt, tmp) { - list_del_init(&fmt->list); - list_del_init(&fmt->sort_list); + list_del(&fmt->sort_list); fmt_free(fmt); } } -- 2.9.4