linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: aneesh.kumar@linux.vnet.ibm.com, mpe@ellerman.id.au
Subject: [RFC 1/4] powerpc/mm: Rename variable to reflect start address of a section
Date: Wed, 17 Feb 2016 17:42:56 +0530	[thread overview]
Message-ID: <1455711179-20357-1-git-send-email-khandual@linux.vnet.ibm.com> (raw)

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.

Fixes: 16a05bff1 ("powerpc: start loop at section start of start in vmemmap_populated()")
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
 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 379a6a9..d6b9b4d 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -170,11 +170,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;
-- 
2.1.0

             reply	other threads:[~2016-02-17 12:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 12:12 Anshuman Khandual [this message]
2016-02-17 12:12 ` [RFC 2/4] powerpc/mm: Add comments to the vmemmap layout Anshuman Khandual
2016-02-17 14:49   ` Aneesh Kumar K.V
2016-02-18 14:22   ` Michael Ellerman
2016-02-19  5:15     ` Anshuman Khandual
2016-02-17 12:12 ` [RFC 3/4] powerpc/mm: Rename the vmemmap_backing struct and its elements Anshuman Khandual
2016-02-17 14:52   ` Aneesh Kumar K.V
2016-02-18 14:23     ` Michael Ellerman
2016-02-17 12:12 ` [RFC 4/4] powerpc/mm: Rename global tracker for virtual to physical mapping Anshuman Khandual
2016-02-18 14:37   ` Michael Ellerman
2016-02-19  4:54     ` Anshuman Khandual
2016-02-19 10:30       ` Michael Ellerman
2016-02-19 11:02         ` Anshuman Khandual
2016-02-18 14:34 ` [RFC 1/4] powerpc/mm: Rename variable to reflect start address of a section Michael Ellerman
2016-02-19  4:50   ` Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455711179-20357-1-git-send-email-khandual@linux.vnet.ibm.com \
    --to=khandual@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).