Skip to content

Commit f1dc0db

Browse files
DerDakontorvalds
authored andcommitted
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.com Signed-off-by: Rolf Eike Beer <eb@emlix.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7866076 commit f1dc0db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/mmzone.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ static inline int pfn_valid(unsigned long pfn)
14811481

14821482
if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
14831483
return 0;
1484-
ms = __nr_to_section(pfn_to_section_nr(pfn));
1484+
ms = __pfn_to_section(pfn);
14851485
if (!valid_section(ms))
14861486
return 0;
14871487
/*
@@ -1496,7 +1496,7 @@ static inline int pfn_in_present_section(unsigned long pfn)
14961496
{
14971497
if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
14981498
return 0;
1499-
return present_section(__nr_to_section(pfn_to_section_nr(pfn)));
1499+
return present_section(__pfn_to_section(pfn));
15001500
}
15011501

15021502
static inline unsigned long next_present_section_nr(unsigned long section_nr)

0 commit comments

Comments
 (0)