Skip to content

Commit e3c40f3

Browse files
dkipertorvalds
authored andcommitted
mm: pfn_to_section_nr()/section_nr_to_pfn() is valid only in CONFIG_SPARSEMEM context
pfn_to_section_nr()/section_nr_to_pfn() is valid only in CONFIG_SPARSEMEM context. Move it to proper place. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Cc: Dave Hansen <dave@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent bf4e890 commit e3c40f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/linux/mmzone.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn)
928928
#define pfn_to_nid(pfn) (0)
929929
#endif
930930

931-
#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT)
932-
#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT)
933-
934931
#ifdef CONFIG_SPARSEMEM
935932

936933
/*
@@ -956,6 +953,9 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn)
956953
#error Allocator MAX_ORDER exceeds SECTION_SIZE
957954
#endif
958955

956+
#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT)
957+
#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT)
958+
959959
struct page;
960960
struct page_cgroup;
961961
struct mem_section {

0 commit comments

Comments
 (0)