2008-03-01 04:08:01

by Christoph Lameter

[permalink] [raw]
Subject: [rfc 09/10] Get rid of __ZONE_COUNT

It was used to compensate because MAX_NR_ZONES was not available
to the #ifdefs.

Signed-off-by: Christoph Lameter <[email protected]>

---
include/linux/mmzone.h | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)

Index: linux-2.6/include/linux/mmzone.h
===================================================================
--- linux-2.6.orig/include/linux/mmzone.h 2008-02-29 19:34:28.000000000 -0800
+++ linux-2.6/include/linux/mmzone.h 2008-02-29 19:35:32.000000000 -0800
@@ -189,28 +189,15 @@ enum zone_type {
* match the requested limits. See gfp_zone() in include/linux/gfp.h
*/

-/*
- * Count the active zones. Note that the use of defined(X) outside
- * #if and family is not necessarily defined so ensure we cannot use
- * it later. Use __ZONE_COUNT to work out how many shift bits we need.
- */
-#define __ZONE_COUNT ( \
- defined(CONFIG_ZONE_DMA) \
- + defined(CONFIG_ZONE_DMA32) \
- + 1 \
- + defined(CONFIG_HIGHMEM) \
- + 1 \
-)
-#if __ZONE_COUNT < 2
+#if MAX_NR_ZONES < 2
#define ZONES_SHIFT 0
-#elif __ZONE_COUNT <= 2
+#elif MAX_NR_ZONES <= 2
#define ZONES_SHIFT 1
-#elif __ZONE_COUNT <= 4
+#elif MAX_NR_ZONES <= 4
#define ZONES_SHIFT 2
#else
#error ZONES_SHIFT -- too many zones configured adjust calculation
#endif
-#undef __ZONE_COUNT

struct zone {
/* Fields commonly accessed by the page allocator */

--