linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc/mm: Rename variable to reflect start address of a section
@ 2017-04-06 14:14 Anshuman Khandual
  2017-04-06 14:14 ` [PATCH 2/3] powerpc/mm: Add comments to the vmemmap layout Anshuman Khandual
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anshuman Khandual @ 2017-04-06 14:14 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: aneesh.kumar, mpe

The commit (16a05bff1: powerpc: start loop at section start of
start in vmemmap_populated()) reused 'start' variable to compute
the starting address of the memory section where the given address
belongs. Then the same variable is used for iterating over starting
address of all memory sections before reaching the 'end' address.
Renaming it as 'section_start' makes the logic more clear.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
Previous discussions on this http://patchwork.ozlabs.org/patch/584103/

 arch/powerpc/mm/init_64.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index c22f207..2a15986 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -104,11 +104,15 @@ static unsigned long __meminit vmemmap_section_start(unsigned long page)
  */
 static int __meminit vmemmap_populated(unsigned long start, int page_size)
 {
-	unsigned long end = start + page_size;
-	start = (unsigned long)(pfn_to_page(vmemmap_section_start(start)));
+	unsigned long end, section_start;
 
-	for (; start < end; start += (PAGES_PER_SECTION * sizeof(struct page)))
-		if (pfn_valid(page_to_pfn((struct page *)start)))
+	end = start + page_size;
+	section_start = (unsigned long)(pfn_to_page
+					(vmemmap_section_start(start)));
+
+	for (; section_start < end; section_start
+				+= (PAGES_PER_SECTION * sizeof(struct page)))
+		if (pfn_valid(page_to_pfn((struct page *)section_start)))
 			return 1;
 
 	return 0;
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-29 12:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06 14:14 [PATCH 1/3] powerpc/mm: Rename variable to reflect start address of a section Anshuman Khandual
2017-04-06 14:14 ` [PATCH 2/3] powerpc/mm: Add comments to the vmemmap layout Anshuman Khandual
2017-06-29 12:21   ` [2/3] " Michael Ellerman
2017-04-06 14:14 ` [PATCH 3/3] powerpc/mm: Add comments on vmemmap physical mapping Anshuman Khandual
2017-06-29 12:21   ` [3/3] " Michael Ellerman
2017-04-14 13:37 ` [PATCH 1/3] powerpc/mm: Rename variable to reflect start address of a section Anshuman Khandual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).