diff mbox series

mm/memory_hotplug: use __pfn_to_section() instead of open-coding

Message ID 1584345134-16671-1-git-send-email-qiwuchen55@gmail.com (mailing list archive)
State New, archived
Headers show
Series mm/memory_hotplug: use __pfn_to_section() instead of open-coding | expand

Commit Message

chenqiwu March 16, 2020, 7:52 a.m. UTC
From: chenqiwu <chenqiwu@xiaomi.com>

Use __pfn_to_section() API instead of open-coding or better
code readability.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
 mm/memory_hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand March 16, 2020, 12:23 p.m. UTC | #1
On 16.03.20 08:52, qiwuchen55@gmail.com wrote:
> From: chenqiwu <chenqiwu@xiaomi.com>
> 
> Use __pfn_to_section() API instead of open-coding or better

s/or/for/

> code readability.
> 
> Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
> ---
>  mm/memory_hotplug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 19389cd..62e9c66 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -494,7 +494,7 @@ static void __remove_section(unsigned long pfn, unsigned long nr_pages,
>  			     unsigned long map_offset,
>  			     struct vmem_altmap *altmap)
>  {
> -	struct mem_section *ms = __nr_to_section(pfn_to_section_nr(pfn));
> +	struct mem_section *ms = __pfn_to_section(pfn);
>  
>  	if (WARN_ON_ONCE(!valid_section(ms)))
>  		return;
> 

Acked-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 19389cd..62e9c66 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -494,7 +494,7 @@  static void __remove_section(unsigned long pfn, unsigned long nr_pages,
 			     unsigned long map_offset,
 			     struct vmem_altmap *altmap)
 {
-	struct mem_section *ms = __nr_to_section(pfn_to_section_nr(pfn));
+	struct mem_section *ms = __pfn_to_section(pfn);
 
 	if (WARN_ON_ONCE(!valid_section(ms)))
 		return;