public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@kernel.org, tglx@linutronix.de, wangnan0@huawei.com,
	namhyung@kernel.org, adrian.hunter@intel.com, mingo@kernel.org,
	dsahern@gmail.com, acme@redhat.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: [tip:perf/core] perf tools: Be consistent on the type of map->symbols[] interator
Date: Thu, 16 Feb 2017 12:04:28 -0800	[thread overview]
Message-ID: <tip-i6uyo6bsopa2dghnx8qo7rri@git.kernel.org> (raw)

Commit-ID:  a0b2f5af4c99d3da7ce9bc2b3b4641c8ffd22615
Gitweb:     http://git.kernel.org/tip/a0b2f5af4c99d3da7ce9bc2b3b4641c8ffd22615
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 14 Feb 2017 16:19:56 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 14 Feb 2017 16:19:56 -0300

perf tools: Be consistent on the type of map->symbols[] interator

In a few cases we were using 'enum map_type' and that triggered this
warning when using clang:

  util/session.c:1923:16: error: comparison of constant 2 with expression of type 'enum map_type' is always true
      [-Werror,-Wtautological-constant-out-of-range-compare]
        for (i = 0; i < MAP__NR_TYPES; ++i) {

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-i6uyo6bsopa2dghnx8qo7rri@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/machine.c | 4 ++--
 tools/perf/util/session.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index a1043cf..71c9720 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -782,7 +782,7 @@ static u64 machine__get_running_kernel_start(struct machine *machine,
 
 int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel)
 {
-	enum map_type type;
+	int type;
 	u64 start = machine__get_running_kernel_start(machine, NULL);
 
 	/* In case of renewal the kernel map, destroy previous one */
@@ -813,7 +813,7 @@ int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel)
 
 void machine__destroy_kernel_maps(struct machine *machine)
 {
-	enum map_type type;
+	int type;
 
 	for (type = 0; type < MAP__NR_TYPES; ++type) {
 		struct kmap *kmap;
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 349c681..4cdbc8f 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1901,7 +1901,7 @@ int maps__set_kallsyms_ref_reloc_sym(struct map **maps,
 				     const char *symbol_name, u64 addr)
 {
 	char *bracket;
-	enum map_type i;
+	int i;
 	struct ref_reloc_sym *ref;
 
 	ref = zalloc(sizeof(struct ref_reloc_sym));

                 reply	other threads:[~2017-02-16 20:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=tip-i6uyo6bsopa2dghnx8qo7rri@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wangnan0@huawei.com \
    /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