linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Mel Gorman <mgorman@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm: Simplify for_each_populated_zone()
Date: Wed, 10 Apr 2013 13:41:24 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1304101339260.25932@chino.kir.corp.google.com> (raw)
In-Reply-To: <20130410202727.20368.29222.stgit@srivatsabhat.in.ibm.com>

On Thu, 11 Apr 2013, Srivatsa S. Bhat wrote:

> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index ede2749..2489042 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -948,9 +948,7 @@ extern struct zone *next_zone(struct zone *zone);
>  	for (zone = (first_online_pgdat())->node_zones; \
>  	     zone;					\
>  	     zone = next_zone(zone))			\
> -		if (!populated_zone(zone))		\
> -			; /* do nothing */		\
> -		else
> +		if (populated_zone(zone))
>  
>  static inline struct zone *zonelist_zone(struct zoneref *zoneref)
>  {

Nack, it's written the way it is to avoid ambiguous else statements 
following it.  People do things like

	for_each_populated_zone(z)
		if (...) {
		} else (...) {
		}

and it's now ambiguous (and should warn with -Wparentheses).

--
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>

  reply	other threads:[~2013-04-10 20:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 20:27 Srivatsa S. Bhat
2013-04-10 20:41 ` David Rientjes [this message]
2013-04-10 20:42   ` Srivatsa S. Bhat
  -- strict thread matches above, loose matches on Subject: below --
2012-10-19 10:55 Srivatsa S. Bhat
2012-10-19 13:54 ` Johannes Weiner
2012-10-19 14:26   ` Srivatsa S. Bhat

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.02.1304101339260.25932@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=srivatsa.bhat@linux.vnet.ibm.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