linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memory_hotplug: use __pfn_to_section() instead of open-coding
@ 2020-03-16  7:52 qiwuchen55
  2020-03-16 12:23 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: qiwuchen55 @ 2020-03-16  7:52 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, chenqiwu

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

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;
-- 
1.9.1



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

* Re: [PATCH] mm/memory_hotplug: use __pfn_to_section() instead of open-coding
  2020-03-16  7:52 [PATCH] mm/memory_hotplug: use __pfn_to_section() instead of open-coding qiwuchen55
@ 2020-03-16 12:23 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2020-03-16 12:23 UTC (permalink / raw)
  To: qiwuchen55, akpm; +Cc: linux-mm, chenqiwu

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>

-- 
Thanks,

David / dhildenb



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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16  7:52 [PATCH] mm/memory_hotplug: use __pfn_to_section() instead of open-coding qiwuchen55
2020-03-16 12:23 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox