linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] perf parse-events: Avoid enum forward declaration.
Date: Wed, 15 Sep 2021 18:21:18 -0300	[thread overview]
Message-ID: <YUJjzr8lvelSKET1@kernel.org> (raw)
In-Reply-To: <20210915211428.1773567-1-irogers@google.com>

Em Wed, Sep 15, 2021 at 02:14:28PM -0700, Ian Rogers escreveu:
> 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 {
>      ^

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/util/parse-events.c | 2 +-
>  tools/perf/util/parse-events.h | 3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index 51a2219df601..5d1346aa0627 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -1471,7 +1471,7 @@ int parse_events_add_numeric(struct parse_events_state *parse_state,
>  
>  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);
>  }
> diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
> index bf6e41aa9b6a..b32ed3064c49 100644
> --- a/tools/perf/util/parse-events.h
> +++ b/tools/perf/util/parse-events.h
> @@ -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,
> -- 
> 2.33.0.309.g3052b89438-goog

-- 

- Arnaldo

      reply	other threads:[~2021-09-15 21:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 21:14 [PATCH] perf parse-events: Avoid enum forward declaration Ian Rogers
2021-09-15 21:21 ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUJjzr8lvelSKET1@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).