perf parse-events: fix an incompatible pointer
Ian Rogers
reviewerPATCH 1/2 perf parse-events: fix an incompatible pointer
Arrays are pointer types and don't need their address taking.
Fixes 8255718f4bed (perf pmu: Expand PMU events by prefix match)
Signed-off-by Ian Rogers <[email protected]>
--- tools/perf/util/parse-events.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/parse-events.y +1 -1
@@ -349,7 +349,7 @@ PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc struct list_head *list; char pmu_name[128]; - snprintf(&pmu_name, 128, "%s-%s", $1, $3); + snprintf(pmu_name, sizeof(pmu_name), "%s-%s", $1, $3); free($1); free($3); if (parse_events_multi_pmu_add(_parse_state, pmu_name, &list) < 0)
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
Ian Rogers
reviewerPATCH 2/2 perf parse-events: fix an old style declaration
Fixes a26e47162d76 (perf tools: Move ALLOC_LIST into a function)
Signed-off-by Ian Rogers <[email protected]>
--- tools/perf/util/parse-events.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/parse-events.y +1 -1
@@ -26,7 +26,7 @@ do { \ YYABORT; \ } while (0) -static struct list_head* alloc_list() +static struct list_head* alloc_list(void) { struct list_head *list;
Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
Re: [PATCH 2/2] perf parse-events: fix an old style declaration
Em Mon, Jun 08, 2020 at 10:36:10PM -0700, Ian Rogers escreveu:
Quoted 11 lines
Fixes a26e47162d76 (perf tools: Move ALLOC_LIST into a function)Signed-off-by Ian Rogers <[email protected]>--- tools/perf/util/parse-events.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/parse-events.y +0
-0
tools/perf/util/parse-events.y do { \ · line 31
Quoted 7 lines
tools/perf/util/parse-events.y +1
-1@@ -26,7 +26,7 @@ do { \ YYABORT; \ } while (0) -static struct list_head* alloc_list() +static struct list_head* alloc_list(void) { struct list_head *list;
Thanks, applied.
- Arnaldo
Em Mon, Jun 08, 2020 at 10:36:09PM -0700, Ian Rogers escreveu:
Quoted 2 lines
Arrays are pointer types and don't need their address taking.
Fixes 8255718f4bed (perf pmu: Expand PMU events by prefix match)
Thanks, applied.
- Arnaldo
Quoted 21 lines
Signed-off-by Ian Rogers <[email protected]>--- tools/perf/util/parse-events.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/parse-events.y +1
-1@@ -349,7 +349,7 @@ PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc struct list_head *list; char pmu_name[128]; - snprintf(&pmu_name, 128, "%s-%s", $1, $3); + snprintf(pmu_name, sizeof(pmu_name), "%s-%s", $1, $3); free($1); free($3); if (parse_events_multi_pmu_add(_parse_state, pmu_name, &list) < 0)Signature · 1 line
2.27.0.278.ge193c7cf3a9-goog
Signature · 1 line
- Arnaldo