diff mbox series

mm/sparsemem: use wrapped macros instead of open-coding

Message ID 1583487416-15954-1-git-send-email-qiwuchen55@gmail.com (mailing list archive)
State New, archived
Headers show
Series mm/sparsemem: use wrapped macros instead of open-coding | expand

Commit Message

chenqiwu March 6, 2020, 9:36 a.m. UTC
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 mbox series

Patch

diff --git a/mm/sparse.c b/mm/sparse.c
index 42c18a3..73e1038 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(usemap));
+	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;