]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mm: use __pfn_to_section() instead of open coding it
authorRolf Eike Beer <eb@emlix.com>
Fri, 5 Nov 2021 20:38:15 +0000 (13:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:42:00 +0000 (08:42 +0100)
[ Upstream commit f1dc0db296bd25960273649fc6ef2ecbf5aaa0e0 ]

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>
Stable-dep-of: 5ec8e8ea8b77 ("mm/sparsemem: fix race in accessing memory_section->usage")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/mmzone.h

index b2e4599b88832e2d5cab2dc677bd48f490ed63fb..11fa11c31fdaecc5bf8a1142df188aa3f89f3200 100644 (file)
@@ -1369,7 +1369,7 @@ static inline int pfn_valid(unsigned long pfn)
 
        if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
                return 0;
-       ms = __nr_to_section(pfn_to_section_nr(pfn));
+       ms = __pfn_to_section(pfn);
        if (!valid_section(ms))
                return 0;
        /*
@@ -1384,7 +1384,7 @@ static inline int pfn_in_present_section(unsigned long pfn)
 {
        if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
                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)