Skip to content

Commit

Permalink
mm: page_alloc: catch out-of-date list of page flag names
Browse files Browse the repository at this point in the history
String tables with names of enum items are always prone to go out of
sync with the enums themselves.  Ensure during compile time that the
name table of page flags has the same size as the page flags enum.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed May 29, 2012
1 parent be9cd87 commit acc50c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5985,6 +5985,8 @@ static void dump_page_flags(unsigned long flags)
unsigned long mask;
int i;

BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) - 1 != __NR_PAGEFLAGS);

printk(KERN_ALERT "page flags: %#lx(", flags);

/* remove zone id */
Expand Down

0 comments on commit acc50c1

Please sign in to comment.