Skip to content

Commit

Permalink
mm: use __pfn_to_section() instead of open coding it
Browse files Browse the repository at this point in the history
[ Upstream commit f1dc0db ]

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: 5ec8e8e ("mm/sparsemem: fix race in accessing memory_section->usage")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Rolf Eike Beer authored and Greg Kroah-Hartman committed Feb 23, 2024
1 parent 1b1036c commit 904fafa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,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;
/*
Expand All @@ -1508,7 +1508,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)
Expand Down

0 comments on commit 904fafa

Please sign in to comment.