From: Johannes Weiner Date: Tue, 29 May 2012 22:06:44 +0000 (-0700) Subject: mm: page_alloc: catch out-of-date list of page flag names X-Git-Tag: v3.12-rc1~3053^2~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acc50c110cf6f1a8bd1af410b2c7bc29ca624678;p=kernel%2Fkernel-generic.git mm: page_alloc: catch out-of-date list of page flag names 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 Cc: Gavin Shan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 72869ea..5712898 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -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 */