Commit f1dc0db2 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Linus Torvalds

mm: use __pfn_to_section() instead of open coding it

It is defined in the same file just a few lines above.

Link: https://lkml.kernel.org/r/4598487.Rc0NezkW7i@mobilepool36.emlix.comSigned-off-by: default avatarRolf Eike Beer <eb@emlix.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7866076b
...@@ -1481,7 +1481,7 @@ static inline int pfn_valid(unsigned long pfn) ...@@ -1481,7 +1481,7 @@ static inline int pfn_valid(unsigned long pfn)
if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
return 0; return 0;
ms = __nr_to_section(pfn_to_section_nr(pfn)); ms = __pfn_to_section(pfn);
if (!valid_section(ms)) if (!valid_section(ms))
return 0; return 0;
/* /*
...@@ -1496,7 +1496,7 @@ static inline int pfn_in_present_section(unsigned long pfn) ...@@ -1496,7 +1496,7 @@ static inline int pfn_in_present_section(unsigned long pfn)
{ {
if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
return 0; return 0;
return present_section(__nr_to_section(pfn_to_section_nr(pfn))); return present_section(__pfn_to_section(pfn));
} }
static inline unsigned long next_present_section_nr(unsigned long section_nr) static inline unsigned long next_present_section_nr(unsigned long section_nr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment