Skip to content

Commit

Permalink
mm/memory_hotplug.c: use __pfn_to_section() instead of open-coding
Browse files Browse the repository at this point in the history
Use __pfn_to_section() API instead of open-coding for better code
readability.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Hildenbrand <david@redhat.com>
Link: http://lkml.kernel.org/r/1584345134-16671-1-git-send-email-qiwuchen55@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
chenqiwu authored and Linus Torvalds committed Apr 7, 2020
1 parent 5f47adf commit 1040490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,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;
Expand Down

0 comments on commit 1040490

Please sign in to comment.