mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
perf tools: Stop using 'self' in strlist
As suggested by tglx, 'self' should be replaced by something that is more useful. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-933537sxtcz47qs0e0ledmrp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
e23c1a5578
commit
d8639f068a
2 changed files with 48 additions and 48 deletions
|
@ -17,34 +17,34 @@ struct strlist {
|
|||
};
|
||||
|
||||
struct strlist *strlist__new(bool dupstr, const char *slist);
|
||||
void strlist__delete(struct strlist *self);
|
||||
void strlist__delete(struct strlist *slist);
|
||||
|
||||
void strlist__remove(struct strlist *self, struct str_node *sn);
|
||||
int strlist__load(struct strlist *self, const char *filename);
|
||||
int strlist__add(struct strlist *self, const char *str);
|
||||
void strlist__remove(struct strlist *slist, struct str_node *sn);
|
||||
int strlist__load(struct strlist *slist, const char *filename);
|
||||
int strlist__add(struct strlist *slist, const char *str);
|
||||
|
||||
struct str_node *strlist__entry(const struct strlist *self, unsigned int idx);
|
||||
struct str_node *strlist__find(struct strlist *self, const char *entry);
|
||||
struct str_node *strlist__entry(const struct strlist *slist, unsigned int idx);
|
||||
struct str_node *strlist__find(struct strlist *slist, const char *entry);
|
||||
|
||||
static inline bool strlist__has_entry(struct strlist *self, const char *entry)
|
||||
static inline bool strlist__has_entry(struct strlist *slist, const char *entry)
|
||||
{
|
||||
return strlist__find(self, entry) != NULL;
|
||||
return strlist__find(slist, entry) != NULL;
|
||||
}
|
||||
|
||||
static inline bool strlist__empty(const struct strlist *self)
|
||||
static inline bool strlist__empty(const struct strlist *slist)
|
||||
{
|
||||
return rblist__empty(&self->rblist);
|
||||
return rblist__empty(&slist->rblist);
|
||||
}
|
||||
|
||||
static inline unsigned int strlist__nr_entries(const struct strlist *self)
|
||||
static inline unsigned int strlist__nr_entries(const struct strlist *slist)
|
||||
{
|
||||
return rblist__nr_entries(&self->rblist);
|
||||
return rblist__nr_entries(&slist->rblist);
|
||||
}
|
||||
|
||||
/* For strlist iteration */
|
||||
static inline struct str_node *strlist__first(struct strlist *self)
|
||||
static inline struct str_node *strlist__first(struct strlist *slist)
|
||||
{
|
||||
struct rb_node *rn = rb_first(&self->rblist.entries);
|
||||
struct rb_node *rn = rb_first(&slist->rblist.entries);
|
||||
return rn ? rb_entry(rn, struct str_node, rb_node) : NULL;
|
||||
}
|
||||
static inline struct str_node *strlist__next(struct str_node *sn)
|
||||
|
@ -59,21 +59,21 @@ static inline struct str_node *strlist__next(struct str_node *sn)
|
|||
/**
|
||||
* strlist_for_each - iterate over a strlist
|
||||
* @pos: the &struct str_node to use as a loop cursor.
|
||||
* @self: the &struct strlist for loop.
|
||||
* @slist: the &struct strlist for loop.
|
||||
*/
|
||||
#define strlist__for_each(pos, self) \
|
||||
for (pos = strlist__first(self); pos; pos = strlist__next(pos))
|
||||
#define strlist__for_each(pos, slist) \
|
||||
for (pos = strlist__first(slist); pos; pos = strlist__next(pos))
|
||||
|
||||
/**
|
||||
* strlist_for_each_safe - iterate over a strlist safe against removal of
|
||||
* str_node
|
||||
* @pos: the &struct str_node to use as a loop cursor.
|
||||
* @n: another &struct str_node to use as temporary storage.
|
||||
* @self: the &struct strlist for loop.
|
||||
* @slist: the &struct strlist for loop.
|
||||
*/
|
||||
#define strlist__for_each_safe(pos, n, self) \
|
||||
for (pos = strlist__first(self), n = strlist__next(pos); pos;\
|
||||
#define strlist__for_each_safe(pos, n, slist) \
|
||||
for (pos = strlist__first(slist), n = strlist__next(pos); pos;\
|
||||
pos = n, n = strlist__next(n))
|
||||
|
||||
int strlist__parse_list(struct strlist *self, const char *s);
|
||||
int strlist__parse_list(struct strlist *slist, const char *s);
|
||||
#endif /* __PERF_STRLIST_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue