From: qiwuchen55@gmail.com
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, chenqiwu <chenqiwu@xiaomi.com>
Subject: [RESEND PATCH] mm/sparsemem: use wrapped macros instead of open-coding
Date: Fri, 6 Mar 2020 18:19:26 +0800 [thread overview]
Message-ID: <1583489966-16390-1-git-send-email-qiwuchen55@gmail.com> (raw)
From: chenqiwu <chenqiwu@xiaomi.com>
Use wrapped macros instead of open-coding for better code
readability.
Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
mm/sparse.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/sparse.c b/mm/sparse.c
index 42c18a3..9b14164 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -385,8 +385,8 @@ static void __init check_usemap_section_nr(int nid,
old_pgdat_snr = NR_MEM_SECTIONS;
}
- usemap_snr = pfn_to_section_nr(__pa(usage) >> PAGE_SHIFT);
- pgdat_snr = pfn_to_section_nr(__pa(pgdat) >> PAGE_SHIFT);
+ usemap_snr = pfn_to_section_nr(virt_to_pfn(usage));
+ pgdat_snr = pfn_to_section_nr(virt_to_pfn(pgdat));
if (usemap_snr == pgdat_snr)
return;
@@ -677,7 +677,7 @@ struct page * __meminit populate_section_memmap(unsigned long pfn,
return NULL;
got_map_page:
- ret = (struct page *)pfn_to_kaddr(page_to_pfn(page));
+ ret = (struct page *)page_to_virt(page);
got_map_ptr:
return ret;
--
1.9.1
next reply other threads:[~2020-03-06 10:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-06 10:19 qiwuchen55 [this message]
2020-03-11 2:10 ` [RESEND PATCH] mm/sparsemem: use wrapped macros instead of open-coding John Hubbard
2020-03-11 8:01 ` chenqiwu
2020-03-12 1:09 ` John Hubbard
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=1583489966-16390-1-git-send-email-qiwuchen55@gmail.com \
--to=qiwuchen55@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chenqiwu@xiaomi.com \
--cc=linux-mm@kvack.org \
/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).