lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sun, 26 Jun 2016 04:00:50 -0700
From:	tip-bot for Taeung Song <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	jolsa@...nel.org, hpa@...or.com,
	alexander.shishkin@...ux.intel.com, mhiramat@...nel.org,
	wangnan0@...wei.com, peterz@...radead.org,
	linux-kernel@...r.kernel.org, mingo@...nel.org,
	treeze.taeung@...il.com, acme@...hat.com, namhyung@...nel.org,
	tglx@...utronix.de
Subject: [tip:perf/core] perf config: Reimplement show_config() using
 config_set__for_each

Commit-ID:  4a35b3497c413de8b409f9d75700eeb4772b21b8
Gitweb:     http://git.kernel.org/tip/4a35b3497c413de8b409f9d75700eeb4772b21b8
Author:     Taeung Song <treeze.taeung@...il.com>
AuthorDate: Thu, 23 Jun 2016 23:14:32 +0900
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 23 Jun 2016 17:23:00 -0300

perf config: Reimplement show_config() using config_set__for_each

Recently config_set__for_each got added.  In order to let show_config()
be short and clear, rewrite this function using it.

Signed-off-by: Taeung Song <treeze.taeung@...il.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/r/1466691272-24117-4-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/builtin-config.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
index cfd1036..e4207a2 100644
--- a/tools/perf/builtin-config.c
+++ b/tools/perf/builtin-config.c
@@ -37,23 +37,16 @@ static int show_config(struct perf_config_set *set)
 {
 	struct perf_config_section *section;
 	struct perf_config_item *item;
-	struct list_head *sections;
 
 	if (set == NULL)
 		return -1;
 
-	sections = &set->sections;
-	if (list_empty(sections))
-		return -1;
-
-	list_for_each_entry(section, sections, node) {
-		list_for_each_entry(item, &section->items, node) {
-			char *value = item->value;
+	perf_config_set__for_each_entry(set, section, item) {
+		char *value = item->value;
 
-			if (value)
-				printf("%s.%s=%s\n", section->name,
-				       item->name, value);
-		}
+		if (value)
+			printf("%s.%s=%s\n", section->name,
+			       item->name, value);
 	}
 
 	return 0;

Powered by blists - more mailing lists