* [PATCH] arm: mm: use __pfn_to_section() to get mem_section
@ 2020-04-30 4:04 Guixiong Wei
2020-04-30 5:01 ` Anshuman Khandual
0 siblings, 1 reply; 2+ messages in thread
From: Guixiong Wei @ 2020-04-30 4:04 UTC (permalink / raw)
To: catalin.marinas, will
Cc: nsaenzjulienne, steve.capper, akpm, guro, tglx, rppt,
linux-arm-kernel, linux-kernel, Guixiong Wei
Use __pfn_to_section() to get mem_section, instead of open-coding it.
No semantic changes.
Signed-off-by: Guixiong Wei <guixiongwei@gmail.com>
---
arch/arm64/mm/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] arm: mm: use __pfn_to_section() to get mem_section
2020-04-30 4:04 [PATCH] arm: mm: use __pfn_to_section() to get mem_section Guixiong Wei
@ 2020-04-30 5:01 ` Anshuman Khandual
0 siblings, 0 replies; 2+ messages in thread
From: Anshuman Khandual @ 2020-04-30 5:01 UTC (permalink / raw)
To: Guixiong Wei, catalin.marinas, will
Cc: steve.capper, linux-kernel, rppt, linux-arm-kernel, guro, akpm,
tglx, nsaenzjulienne
On 04/30/2020 09:34 AM, Guixiong Wei wrote:
> Use __pfn_to_section() to get mem_section, instead of open-coding it.
There is no open coding here. __pfn_to_section() helper which already
wraps around __nr_to_section(pfn_to_section_nr(pfn)), should be used
directly instead.
> No semantic changes.
and functional change. Please reword the commit message.
>
> Signed-off-by: Guixiong Wei <guixiongwei@gmail.com>
> ---
> arch/arm64/mm/init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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))
Looks good.
> return 0;
> #endif
> return memblock_is_map_memory(addr);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-30 5:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 4:04 [PATCH] arm: mm: use __pfn_to_section() to get mem_section Guixiong Wei
2020-04-30 5:01 ` Anshuman Khandual
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®