Skip to content

Commit

Permalink
mm: pfn_to_section_nr()/section_nr_to_pfn() is valid only in CONFIG_S…
Browse files Browse the repository at this point in the history
…PARSEMEM 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 <[email protected]>
Cc: Dave Hansen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dkiper authored and torvalds committed May 25, 2011
1 parent bf4e890 commit e3c40f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -928,9 +928,6 @@ static inline unsigned long early_pfn_to_nid(unsigned long pfn)
#define pfn_to_nid(pfn) (0)
#endif

#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT)
#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT)

#ifdef CONFIG_SPARSEMEM

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

#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT)
#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT)

struct page;
struct page_cgroup;
struct mem_section {
Expand Down

0 comments on commit e3c40f3

Please sign in to comment.