[tip:perf/core] perf tests: Make terms a stack variable in test_term

2013-07-19 Thread tip-bot for David Ahern
Commit-ID:  c549aca50134640537bf0fbae43c08fd5ff91932
Gitweb: http://git.kernel.org/tip/c549aca50134640537bf0fbae43c08fd5ff91932
Author: David Ahern 
AuthorDate: Tue, 2 Jul 2013 13:27:24 -0600
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 12 Jul 2013 13:46:17 -0300

perf tests: Make terms a stack variable in test_term

No need to malloc the memory for it.

Signed-off-by: David Ahern 
Cc: Adrian Hunter 
Cc: Frederic Weisbecker 
Cc: Ingo Molnar 
Cc: Jiri Olsa 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Link: 
http://lkml.kernel.org/r/1372793245-4136-6-git-send-email-dsah...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/tests/parse-events.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index ad950f5..344c844 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1246,24 +1246,20 @@ static int test_events(struct evlist_test *events, 
unsigned cnt)
 
 static int test_term(struct terms_test *t)
 {
-   struct list_head *terms;
+   struct list_head terms;
int ret;
 
-   terms = malloc(sizeof(*terms));
-   if (!terms)
-   return -ENOMEM;
-
-   INIT_LIST_HEAD(terms);
+   INIT_LIST_HEAD();
 
-   ret = parse_events_terms(terms, t->str);
+   ret = parse_events_terms(, t->str);
if (ret) {
pr_debug("failed to parse terms '%s', err %d\n",
 t->str , ret);
return ret;
}
 
-   ret = t->check(terms);
-   parse_events__free_terms(terms);
+   ret = t->check();
+   parse_events__free_terms();
 
return ret;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:perf/core] perf tests: Make terms a stack variable in test_term

2013-07-19 Thread tip-bot for David Ahern
Commit-ID:  c549aca50134640537bf0fbae43c08fd5ff91932
Gitweb: http://git.kernel.org/tip/c549aca50134640537bf0fbae43c08fd5ff91932
Author: David Ahern dsah...@gmail.com
AuthorDate: Tue, 2 Jul 2013 13:27:24 -0600
Committer:  Arnaldo Carvalho de Melo a...@redhat.com
CommitDate: Fri, 12 Jul 2013 13:46:17 -0300

perf tests: Make terms a stack variable in test_term

No need to malloc the memory for it.

Signed-off-by: David Ahern dsah...@gmail.com
Cc: Adrian Hunter adrian.hun...@intel.com
Cc: Frederic Weisbecker fweis...@gmail.com
Cc: Ingo Molnar mi...@kernel.org
Cc: Jiri Olsa jo...@redhat.com
Cc: Namhyung Kim namhy...@kernel.org
Cc: Peter Zijlstra pet...@infradead.org
Link: 
http://lkml.kernel.org/r/1372793245-4136-6-git-send-email-dsah...@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo a...@redhat.com
---
 tools/perf/tests/parse-events.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index ad950f5..344c844 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1246,24 +1246,20 @@ static int test_events(struct evlist_test *events, 
unsigned cnt)
 
 static int test_term(struct terms_test *t)
 {
-   struct list_head *terms;
+   struct list_head terms;
int ret;
 
-   terms = malloc(sizeof(*terms));
-   if (!terms)
-   return -ENOMEM;
-
-   INIT_LIST_HEAD(terms);
+   INIT_LIST_HEAD(terms);
 
-   ret = parse_events_terms(terms, t-str);
+   ret = parse_events_terms(terms, t-str);
if (ret) {
pr_debug(failed to parse terms '%s', err %d\n,
 t-str , ret);
return ret;
}
 
-   ret = t-check(terms);
-   parse_events__free_terms(terms);
+   ret = t-check(terms);
+   parse_events__free_terms(terms);
 
return ret;
 }
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/