From e1dbeda60a7ea9e82a908d93c07308d104d50d79 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 6 Dec 2006 20:32:01 -0800 Subject: [PATCH] [PATCH] balance_pdgat() cleanup Despaghettify balance_pdgat() a bit. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/vmscan.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 518540a4a2a6..2e97baa3b2aa 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1172,11 +1172,12 @@ static unsigned long balance_pgdat(pg_data_t *pgdat, int order) if (!zone_watermark_ok(zone, order, zone->pages_high, 0, 0)) { end_zone = i; - goto scan; + break; } } - goto out; -scan: + if (i < 0) + goto out; + for (i = 0; i <= end_zone; i++) { struct zone *zone = pgdat->node_zones + i;