Skip to contentSkip to conversation

remove uneccesary page++

PATCH In review Greg Ungerer 2 participants 2 messages Jan 11, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove uneccesary page++

Remove unecessary page++ from memmap_init_zone loop.

mm/page_alloc.c +1 -1
@@ -1706,7 +1706,7 @@
 	unsigned long end_pfn = start_pfn + size;
 	unsigned long pfn;
 
-	for (pfn = start_pfn; pfn < end_pfn; pfn++, page++) {
+	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
 		if (!early_pfn_valid(pfn))
 			continue;
 		if (!early_pfn_in_nid(pfn, nid))
#1 lore raw
Quoted 8 lines · Greg Ungerer

Remove unecessary page++ from memmap_init_zone loop.

mm/page_alloc.c line 1712

Quoted 8 lines
mm/page_alloc.c +1 -1
@@ -1706,7 +1706,7 @@
 	unsigned long end_pfn = start_pfn + size;
 	unsigned long pfn;
 
-	for (pfn = start_pfn; pfn < end_pfn; pfn++, page++) {
+	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
 		if (!early_pfn_valid(pfn))
 			continue;
 		if (!early_pfn_in_nid(pfn, nid))

You're right. Somebody missed that when we made it re-calculate the struct page each time. Probably from the sparsemem updates. You could also take the page variable and just declare it inside that loop. The use appears to be local there.

                for (pfn = start_pfn; pfn < end_pfn; pfn++) {
                	struct page *page;
                        if (!early_pfn_valid(pfn))
                               continue;
                if (!early_pfn_in_nid(pfn, nid))
                        continue;
                page = pfn_to_page(pfn);

-- Dave