Skip to content

Commit

Permalink
x86 boot: simplify pageblock_bits enum declaration
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Paul Jackson authored and Thomas Gleixner committed May 25, 2008
1 parent cb5dd7c commit c801ed3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions include/linux/pageblock-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit c801ed3

Please sign in to comment.