Commit 1a93205b authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[PATCH] mm: simplify build_zonelists_node by removing the case statement.

Simplify build_zonelists_node by removing the case statement.
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f3fe6512
...@@ -1455,35 +1455,23 @@ void show_free_areas(void) ...@@ -1455,35 +1455,23 @@ void show_free_areas(void)
/* /*
* Builds allocation fallback zone lists. * Builds allocation fallback zone lists.
*
* Add all populated zones of a node to the zonelist.
*/ */
static int __init build_zonelists_node(pg_data_t *pgdat, struct zonelist *zonelist, int j, int k) static int __init build_zonelists_node(pg_data_t *pgdat,
struct zonelist *zonelist, int j, int k)
{ {
switch (k) {
struct zone *zone; struct zone *zone;
default:
BUG(); BUG_ON(k > ZONE_HIGHMEM);
case ZONE_HIGHMEM: for (zone = pgdat->node_zones + k; zone >= pgdat->node_zones; zone--) {
zone = pgdat->node_zones + ZONE_HIGHMEM; if (populated_zone(zone)) {
if (zone->present_pages) {
#ifndef CONFIG_HIGHMEM #ifndef CONFIG_HIGHMEM
BUG(); BUG_ON(zone - pgdat->node_zones > ZONE_NORMAL);
#endif #endif
zonelist->zones[j++] = zone; zonelist->zones[j++] = zone;
} }
case ZONE_NORMAL:
zone = pgdat->node_zones + ZONE_NORMAL;
if (zone->present_pages)
zonelist->zones[j++] = zone;
case ZONE_DMA32:
zone = pgdat->node_zones + ZONE_DMA32;
if (zone->present_pages)
zonelist->zones[j++] = zone;
case ZONE_DMA:
zone = pgdat->node_zones + ZONE_DMA;
if (zone->present_pages)
zonelist->zones[j++] = zone;
} }
return j; return j;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment