summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-05-22 11:52:22 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-05-27 12:21:45 -0300
commit4bb7123dcfa7aa1d963ad4a8f01b88d54a2bb873 (patch)
treec75934a5be0224534f73ae014f3f4bb29b866f3c /tools/perf/util/map.c
parent614c6b570d5157c2cf835d334bc89af071fc2e44 (diff)
downloadlinux-4bb7123dcfa7aa1d963ad4a8f01b88d54a2bb873.tar.gz
linux-4bb7123dcfa7aa1d963ad4a8f01b88d54a2bb873.tar.bz2
linux-4bb7123dcfa7aa1d963ad4a8f01b88d54a2bb873.zip
perf tools: Use maps__first()/map__next()
In a few more remaining places, for consistency. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-c2n7slwtto29wndfttdrhfrx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r--tools/perf/util/map.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index c1bfd0a12a94..898ab92a98dd 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -688,9 +688,10 @@ move_map:
int map_groups__clone(struct map_groups *mg,
struct map_groups *parent, enum map_type type)
{
- struct rb_node *nd;
- for (nd = rb_first(&parent->maps[type]); nd; nd = rb_next(nd)) {
- struct map *map = rb_entry(nd, struct map, rb_node);
+ struct map *map;
+ struct rb_root *maps = &parent->maps[type];
+
+ for (map = maps__first(maps); map; map = map__next(map)) {
struct map *new = map__clone(map);
if (new == NULL)
return -ENOMEM;