linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] mm/sparsemem: use wrapped macros instead of open-coding
@ 2020-03-06 10:19 qiwuchen55
  2020-03-11  2:10 ` John Hubbard
  0 siblings, 1 reply; 4+ messages in thread
From: qiwuchen55 @ 2020-03-06 10:19 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, chenqiwu

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



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

end of thread, other threads:[~2020-03-12  1:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 10:19 [RESEND PATCH] mm/sparsemem: use wrapped macros instead of open-coding qiwuchen55
2020-03-11  2:10 ` John Hubbard
2020-03-11  8:01   ` chenqiwu
2020-03-12  1:09     ` John Hubbard

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).