summaryrefslogtreecommitdiff
path: root/tools/perf/util/strlist.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-09-04 17:07:35 +0400
committerArnd Bergmann <arnd@arndb.de>2012-09-04 17:07:35 +0400
commit3fbb96d275989c604b343b9e39aeea50386756e9 (patch)
tree6a066ece039f798f7d5a6b44453fc889e0e1cf8a /tools/perf/util/strlist.h
parent63487589bf96bfd3fb7d5531f2d966f29ffe397d (diff)
parent863e99a8c1ea2b0391491904297f57a0f6a1fdd6 (diff)
downloadlinux-3fbb96d275989c604b343b9e39aeea50386756e9.tar.xz
Merge branch 'cleanup/io-pci' into next/cleanup
The io-pci series has gained a merge to resolve a nontrivial conflict. * cleanup/io-pci: ARM: Fix ioremap() of address zero Also includes an update to Linux 3.6-rc3 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'tools/perf/util/strlist.h')
-rw-r--r--tools/perf/util/strlist.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h
index 3ba839007d2c..dd9f922ec67c 100644
--- a/tools/perf/util/strlist.h
+++ b/tools/perf/util/strlist.h
@@ -4,14 +4,15 @@
#include <linux/rbtree.h>
#include <stdbool.h>
+#include "rblist.h"
+
struct str_node {
struct rb_node rb_node;
const char *s;
};
struct strlist {
- struct rb_root entries;
- unsigned int nr_entries;
+ struct rblist rblist;
bool dupstr;
};
@@ -32,18 +33,18 @@ static inline bool strlist__has_entry(struct strlist *self, const char *entry)
static inline bool strlist__empty(const struct strlist *self)
{
- return self->nr_entries == 0;
+ return rblist__empty(&self->rblist);
}
static inline unsigned int strlist__nr_entries(const struct strlist *self)
{
- return self->nr_entries;
+ return rblist__nr_entries(&self->rblist);
}
/* For strlist iteration */
static inline struct str_node *strlist__first(struct strlist *self)
{
- struct rb_node *rn = rb_first(&self->entries);
+ struct rb_node *rn = rb_first(&self->rblist.entries);
return rn ? rb_entry(rn, struct str_node, rb_node) : NULL;
}
static inline struct str_node *strlist__next(struct str_node *sn)