diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2012-05-29 18:06:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:23 -0400 |
commit | 51300cef41c9355a7d428fe0714888d3c72a6f2f (patch) | |
tree | acde5b26bec6d11ac7265b1fcd6a59309907a4c7 /mm/page_alloc.c | |
parent | acc50c110cf6f1a8bd1af410b2c7bc29ca624678 (diff) |
mm/page_alloc.c: cleanups
- make pageflag_names[] const
- remove null termination of pageflag_names[]
Cc: 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>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 5712898c951b..4fc462b5fcf1 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5938,7 +5938,7 @@ bool is_free_buddy_page(struct page *page) | |||
5938 | } | 5938 | } |
5939 | #endif | 5939 | #endif |
5940 | 5940 | ||
5941 | static struct trace_print_flags pageflag_names[] = { | 5941 | static const struct trace_print_flags pageflag_names[] = { |
5942 | {1UL << PG_locked, "locked" }, | 5942 | {1UL << PG_locked, "locked" }, |
5943 | {1UL << PG_error, "error" }, | 5943 | {1UL << PG_error, "error" }, |
5944 | {1UL << PG_referenced, "referenced" }, | 5944 | {1UL << PG_referenced, "referenced" }, |
@@ -5976,7 +5976,6 @@ static struct trace_print_flags pageflag_names[] = { | |||
5976 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 5976 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
5977 | {1UL << PG_compound_lock, "compound_lock" }, | 5977 | {1UL << PG_compound_lock, "compound_lock" }, |
5978 | #endif | 5978 | #endif |
5979 | {-1UL, NULL }, | ||
5980 | }; | 5979 | }; |
5981 | 5980 | ||
5982 | static void dump_page_flags(unsigned long flags) | 5981 | static void dump_page_flags(unsigned long flags) |
@@ -5985,14 +5984,14 @@ static void dump_page_flags(unsigned long flags) | |||
5985 | unsigned long mask; | 5984 | unsigned long mask; |
5986 | int i; | 5985 | int i; |
5987 | 5986 | ||
5988 | BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) - 1 != __NR_PAGEFLAGS); | 5987 | BUILD_BUG_ON(ARRAY_SIZE(pageflag_names) != __NR_PAGEFLAGS); |
5989 | 5988 | ||
5990 | printk(KERN_ALERT "page flags: %#lx(", flags); | 5989 | printk(KERN_ALERT "page flags: %#lx(", flags); |
5991 | 5990 | ||
5992 | /* remove zone id */ | 5991 | /* remove zone id */ |
5993 | flags &= (1UL << NR_PAGEFLAGS) - 1; | 5992 | flags &= (1UL << NR_PAGEFLAGS) - 1; |
5994 | 5993 | ||
5995 | for (i = 0; pageflag_names[i].name && flags; i++) { | 5994 | for (i = 0; i < ARRAY_SIZE(pageflag_names) && flags; i++) { |
5996 | 5995 | ||
5997 | mask = pageflag_names[i].mask; | 5996 | mask = pageflag_names[i].mask; |
5998 | if ((flags & mask) != mask) | 5997 | if ((flags & mask) != mask) |