lkml.org 
[lkml]   [2013]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Simplify for_each_populated_zone()
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).


\
 
 \ /
  Last update: 2013-04-10 23:21    [W:0.042 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site