perf tools: Fix pmu object compilation error
PATCH 1/1 perf tools: Fix pmu object compilation error
After applying some patches got another shadowing error:
CC util/pmu.outil/pmu.c: In function ‘pmu_alias_terms’:util/pmu.c:287:35: error: declaration of ‘clone’ shadows a global declaration [-Werror=shadow]
Renaming clone to cloned.
--- tools/perf/util/pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/pmu.c +3 -3
@@ -284,17 +284,17 @@ static int pmu_aliases(const char *name, struct list_head *head)static int pmu_alias_terms (struct perf_pmu_alias *alias,struct list_head *terms) { -struct parse_events_term *term, *clone; +struct parse_events_term *term, *cloned;LIST_HEAD (list);int ret;list_for_each_entry (term, &alias->terms, list) { - ret =parse_events_term__clone (&clone, term); + ret =parse_events_term__clone (&cloned, term);if (ret) {parse_events__free_terms (&list);return ret; } -list_add_tail (&clone->list, &list); +list_add_tail (&cloned->list, &list); }list_splice (&list, terms);return 0 ;
Signature · 1 line
1.8.3.1
Quoted 31 lines · Jiri Olsa
After applying some patches got another shadowing error:
CC
util/pmu.outil/pmu.c: In function ‘pmu_alias_terms’:util/pmu.c:287:35: error: declaration of ‘clone’ shadows a global declaration [-Werror=shadow]Renaming clone to cloned.
Cc David Ahern <[email protected]>Cc Namhyung Kim <[email protected]>Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tools/perf/util/pmu.c +1
-2@@ -284,17 +284,17 @@ static int pmu_aliases(const char *name, struct list_head *head)static int pmu_alias_terms (struct perf_pmu_alias *alias,struct list_head *terms) { -struct parse_events_term *term, *clone; +struct parse_events_term *term, *cloned;LIST_HEAD (list);int ret;list_for_each_entry (term, &alias->terms, list) { - ret =parse_events_term__clone (&clone, term);
tools/perf/util/pmu.c static int pmu_aliases(const char *name, struct list_head *head) · line 300
Quoted 10 lines
tools/perf/util/pmu.c +2
-1+ ret =parse_events_term__clone (&cloned, term);if (ret) {parse_events__free_terms (&list);return ret; } -list_add_tail (&clone->list, &list); +list_add_tail (&cloned->list, &list); }list_splice (&list, terms);return 0 ;
tip-bot for Jiri Olsa
merge botperf tools: Fix pmu object compilation error
Commit-ID: 7c2f8164e5415ef48954f6929f4acae5764afdb4 Gitweb: http://git.kernel.org/tip/7c2f8164e5415ef48954f6929f4acae5764afdb4 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 16 Apr 2014 20:49:02 +0200 Committer: Jiri Olsa <[email protected]> CommitDate: Tue, 22 Apr 2014 17:39:09 +0200
perf tools: Fix pmu object compilation error
After applying some patches got another shadowing error:
CC util/pmu.outil/pmu.c: In function ‘pmu_alias_terms’:util/pmu.c:287:35: error: declaration of ‘clone’ shadows a global declaration [-Werror=shadow]
Renaming clone to cloned.
--- tools/perf/util/pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/pmu.c +3 -3
@@ -284,17 +284,17 @@ static int pmu_aliases(const char *name, struct list_head *head)static int pmu_alias_terms (struct perf_pmu_alias *alias,struct list_head *terms) { -struct parse_events_term *term, *clone; +struct parse_events_term *term, *cloned;LIST_HEAD (list);int ret;list_for_each_entry (term, &alias->terms, list) { - ret =parse_events_term__clone (&clone, term); + ret =parse_events_term__clone (&cloned, term);if (ret) {parse_events__free_terms (&list);return ret; } -list_add_tail (&clone->list, &list); +list_add_tail (&cloned->list, &list); }list_splice (&list, terms);return 0 ;