lkml.org 
[lkml]   [2012]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Simplify for_each_populated_zone()
On 10/19/2012 07:24 PM, Johannes Weiner wrote:
> On Fri, Oct 19, 2012 at 04:25:47PM +0530, Srivatsa S. Bhat wrote:
>> Move the check for populated_zone() to the control statement of the
>> 'for' loop and get rid of the odd looking if/else block.
>>
>> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
>> ---
>>
>> include/linux/mmzone.h | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>> index 50aaca8..5bdf02e 100644
>> --- a/include/linux/mmzone.h
>> +++ b/include/linux/mmzone.h
>> @@ -913,11 +913,8 @@ extern struct zone *next_zone(struct zone *zone);
>>
>> #define for_each_populated_zone(zone) \
>> for (zone = (first_online_pgdat())->node_zones; \
>> - zone; \
>> - zone = next_zone(zone)) \
>> - if (!populated_zone(zone)) \
>> - ; /* do nothing */ \
>> - else
>> + zone && populated_zone(zone); \
>> + zone = next_zone(zone))
>
> I don't think we want to /abort/ the loop when encountering an
> unpopulated zone.
>

Oops! I totally missed that.. thanks for catching it! Please ignore
the patch.

Regards,
Srivatsa S. Bhat



\
 
 \ /
  Last update: 2012-10-19 17:41    [W:0.034 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site