[PATCH 4/10] x86 boot: simplify pageblock_bits enum declaration

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul Jackson
Date: Wednesday, May 14, 2008 - 8:15 am

From: Paul Jackson <pj@sgi.com>

The use of #defines with '##' pre-processor concatenation is a useful
way to form several symbol names with a common pattern.  But when there
is just a single name obtained from that #define, it's just obfuscation.
Better to just write the plain symbol name, as is.

The following patch is a result of my wasting ten minutes looking through
the kernel to figure out what 'PB_migrate_end' meant, and forgetting what
I came to do, by the time I figured out that the #define PB_range macro
defined it.

Signed-off-by: Paul Jackson <pj@sgi.com>

---
 include/linux/pageblock-flags.h |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- linux.orig/include/linux/pageblock-flags.h	2008-05-13 05:42:39.869811856 -0700
+++ linux/include/linux/pageblock-flags.h	2008-05-13 05:51:47.994829315 -0700
@@ -25,13 +25,11 @@
 
 #include <linux/types.h>
 
-/* Macro to aid the definition of ranges of bits */
-#define PB_range(name, required_bits) \
-	name, name ## _end = (name + required_bits) - 1
-
 /* Bit indices that affect a whole block of pages */
 enum pageblock_bits {
-	PB_range(PB_migrate, 3), /* 3 bits required for migrate types */
+	PB_migrate,
+	PB_migrate_end = PB_migrate + 3 - 1,
+			/* 3 bits required for migrate types */
 	NR_PAGEBLOCK_BITS
 };
 

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/10] x86 boot: include missing smp.h header, Paul Jackson, (Wed May 14, 8:15 am)
[PATCH 4/10] x86 boot: simplify pageblock_bits enum declar ..., Paul Jackson, (Wed May 14, 8:15 am)