Re: [2.6 patch] fix mm/mm_init.c compilation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Monday, August 4, 2008 - 2:05 pm

On Mon, 4 Aug 2008 21:19:15 +0300
Adrian Bunk <bunk@kernel.org> wrote:


OK, ifdefs inside macro expansion aren't a great idea.

Mel, is there any erason why we shouldn't do it this way?

 include/linux/mmzone.h |    3 ++-
 mm/mm_init.c           |    4 ----

 2 files changed, 2 insertions(+), 5 deletions(-)

diff -puN include/linux/mmzone.h~a include/linux/mmzone.h
--- a/include/linux/mmzone.h~a
+++ a/include/linux/mmzone.h
@@ -831,7 +831,7 @@ static inline unsigned long early_pfn_to
 #ifdef CONFIG_SPARSEMEM
 
 /*
- * SECTION_SHIFT    		#bits space required to store a section #
+ * SECTIONS_SHIFT    		#bits space required to store a section #
  *
  * PA_SECTION_SHIFT		physical address to/from section number
  * PFN_SECTION_SHIFT		pfn to/from section number
@@ -973,6 +973,7 @@ static inline int pfn_present(unsigned l
 #define early_pfn_valid(pfn)	pfn_valid(pfn)
 void sparse_init(void);
 #else
+#define SECTIONS_SHIFT		0
 #define sparse_init()	do {} while (0)
 #define sparse_index_init(_sec, _nid)  do {} while (0)
 #endif /* CONFIG_SPARSEMEM */
diff -puN mm/mm_init.c~a mm/mm_init.c
--- a/mm/mm_init.c~a
+++ a/mm/mm_init.c
@@ -74,11 +74,7 @@ void __init mminit_verify_pageflags_layo
 		NR_PAGEFLAGS);
 	mminit_dprintk(MMINIT_TRACE, "pageflags_layout_shifts",
 		"Section %d Node %d Zone %d\n",
-#ifdef SECTIONS_SHIFT
 		SECTIONS_SHIFT,
-#else
-		0,
-#endif
 		NODES_SHIFT,
 		ZONES_SHIFT);
 	mminit_dprintk(MMINIT_TRACE, "pageflags_layout_offsets",
_

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[2.6 patch] fix mm/mm_init.c compilation, Adrian Bunk, (Mon Aug 4, 11:19 am)
Re: [2.6 patch] fix mm/mm_init.c compilation, Andrew Morton, (Mon Aug 4, 2:05 pm)
Re: [2.6 patch] fix mm/mm_init.c compilation, Mel Gorman, (Tue Aug 5, 12:51 am)
Re: [2.6 patch] fix mm/mm_init.c compilation, Andrew Morton, (Tue Aug 5, 2:11 am)