From: David Rientjes <rientjes@google.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Yaowei Bai <baiyaowei@cmss.chinamobile.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Naoya Horiguchi <nao.horiguchi@gmail.com>
Subject: Re: [PATCH v1] mm: fix warning in comparing enumerator
Date: Tue, 1 Dec 2015 14:25:50 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.10.1512011425230.19510@chino.kir.corp.google.com> (raw)
In-Reply-To: <1448959032-754-1-git-send-email-n-horiguchi@ah.jp.nec.com>
On Tue, 1 Dec 2015, Naoya Horiguchi wrote:
> I saw the following warning when building mmotm-2015-11-25-17-08.
>
> mm/page_alloc.c:4185:16: warning: comparison between 'enum zone_type' and 'enum <anonymous>' [-Wenum-compare]
> for (i = 0; i < MAX_ZONELISTS; i++) {
> ^
>
> enum zone_type is named like ZONE_* which is different from ZONELIST_*, so
> we are somehow doing incorrect comparison. Just fixes it.
>
> Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> ---
> mm/page_alloc.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git mmotm-2015-11-25-17-08/mm/page_alloc.c mmotm-2015-11-25-17-08_patched/mm/page_alloc.c
> index e267faa..b801e6f 100644
> --- mmotm-2015-11-25-17-08/mm/page_alloc.c
> +++ mmotm-2015-11-25-17-08_patched/mm/page_alloc.c
> @@ -4174,8 +4174,7 @@ static void set_zonelist_order(void)
>
> static void build_zonelists(pg_data_t *pgdat)
> {
> - int j, node, load;
> - enum zone_type i;
> + int i, j, node, load;
> nodemask_t used_mask;
> int local_node, prev_node;
> struct zonelist *zonelist;
Obviously correct, but I would have thought we could just remove 'j' and
used 'i' as our iterator through the entire function.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-12-01 22:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-01 8:37 Naoya Horiguchi
2015-12-01 22:25 ` David Rientjes [this message]
2015-12-01 23:07 ` [PATCH v2] " Naoya Horiguchi
2015-12-01 23:35 ` David Rientjes
2015-12-02 9:16 ` Yaowei Bai
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=alpine.DEB.2.10.1512011425230.19510@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=baiyaowei@cmss.chinamobile.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=nao.horiguchi@gmail.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