diff mbox series

[v2] arm: mm: use __pfn_to_section() to get mem_section

Message ID 20200430161858.11379-1-guixiongwei@gmail.com (mailing list archive)
State Mainlined
Commit 037d9303a7e7bac622e299817c5dd288346db07c
Headers show
Series [v2] arm: mm: use __pfn_to_section() to get mem_section | expand

Commit Message

Guixiong Wei April 30, 2020, 4:18 p.m. UTC
__pfn_to_section() helper which already wraps around
__nr_to_section(pfn_to_section_nr(pfn)), should be used
directly instead.

Signed-off-by: Guixiong Wei <guixiongwei@gmail.com>
---

v1 -> v2
- reword the commit message.

---
 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Will Deacon April 30, 2020, 9:12 p.m. UTC | #1
On Fri, 1 May 2020 06:18:58 +1400, Guixiong Wei wrote:
> __pfn_to_section() helper which already wraps around
> __nr_to_section(pfn_to_section_nr(pfn)), should be used
> directly instead.

Applied to arm64 (for-next/misc), thanks!

[1/1] arm: mm: use __pfn_to_section() to get mem_section
      https://git.kernel.org/arm64/c/037d9303a7e7

Cheers,
diff mbox series

Patch

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index e42727e3568e..d2df416b840e 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -272,7 +272,7 @@  int pfn_valid(unsigned long pfn)
 	if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
 		return 0;
 
-	if (!valid_section(__nr_to_section(pfn_to_section_nr(pfn))))
+	if (!valid_section(__pfn_to_section(pfn)))
 		return 0;
 #endif
 	return memblock_is_map_memory(addr);