lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1512011425230.19510@chino.kir.corp.google.com>
Date:	Tue, 1 Dec 2015 14:25:50 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Yaowei Bai <baiyaowei@...s.chinamobile.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Naoya Horiguchi <nao.horiguchi@...il.com>
Subject: Re: [PATCH v1] mm: fix warning in comparing enumerator

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@...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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ