perf parse-events: Avoid enum forward declaration.

Enum forward declarations aren't allowed as the size can't be implied.
Switch to just using an int. This fixes a clang warning:

  In file included from tools/perf/bench/evlist-open-close.c:13:
  tools/perf/bench/../util/parse-events.h:185:6: error: redeclaration of already-defined enum 'perf_tool_event' is a GNU extension [-Werror,-Wgnu-redeclared-enum]
  enum perf_tool_event;
       ^
  tools/perf/bench/../util/evsel.h:28:6: note: previous definition is here
  enum perf_tool_event {
       ^

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20210915211428.1773567-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Ian Rogers 2021-09-15 14:14:28 -07:00 committed by Arnaldo Carvalho de Melo
parent 00e0ca3721
commit 8228e9361e
2 changed files with 2 additions and 3 deletions

View File

@ -1471,7 +1471,7 @@ out_free_terms:
int parse_events_add_tool(struct parse_events_state *parse_state,
struct list_head *list,
enum perf_tool_event tool_event)
int tool_event)
{
return add_event_tool(list, &parse_state->idx, tool_event);
}

View File

@ -182,10 +182,9 @@ int parse_events_add_numeric(struct parse_events_state *parse_state,
struct list_head *list,
u32 type, u64 config,
struct list_head *head_config);
enum perf_tool_event;
int parse_events_add_tool(struct parse_events_state *parse_state,
struct list_head *list,
enum perf_tool_event tool_event);
int tool_event);
int parse_events_add_cache(struct list_head *list, int *idx,
char *type, char *op_result1, char *op_result2,
struct parse_events_error *error,