[RFC PATCH 1/4] perf: move setup_list from symbol.c to strlist.c

From: David Ahern
Date: Fri Jun 07 2013 - 18:22:32 EST


Code move only; no functional changes

Signed-off-by: David Ahern <dsahern@xxxxxxxxx>
---
tools/perf/util/strlist.c | 15 +++++++++++++++
tools/perf/util/strlist.h | 2 ++
tools/perf/util/symbol.c | 14 --------------
3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c
index eabdce0..faa0e0f 100644
--- a/tools/perf/util/strlist.c
+++ b/tools/perf/util/strlist.c
@@ -170,3 +170,18 @@ struct str_node *strlist__entry(const struct strlist *slist, unsigned int idx)

return snode;
}
+
+int setup_list(struct strlist **list, const char *list_str,
+ const char *list_name)
+{
+ if (list_str == NULL)
+ return 0;
+
+ *list = strlist__new(true, list_str);
+ if (!*list) {
+ pr_err("problems parsing %s list\n", list_name);
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h
index 5c7f870..a5f433c 100644
--- a/tools/perf/util/strlist.h
+++ b/tools/perf/util/strlist.h
@@ -16,6 +16,8 @@ struct strlist {
bool dupstr;
};

+int setup_list(struct strlist **list, const char *list_str,
+ const char *list_name);
struct strlist *strlist__new(bool dupstr, const char *slist);
void strlist__delete(struct strlist *slist);

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 8cf3b54..3ef8be8 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1164,20 +1164,6 @@ out_fail:
return -1;
}

-static int setup_list(struct strlist **list, const char *list_str,
- const char *list_name)
-{
- if (list_str == NULL)
- return 0;
-
- *list = strlist__new(true, list_str);
- if (!*list) {
- pr_err("problems parsing %s list\n", list_name);
- return -1;
- }
- return 0;
-}
-
static bool symbol__read_kptr_restrict(void)
{
bool value = false;
--
1.7.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/