aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2014-04-07 18:37:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 19:35:55 -0400
commitd230dec18dc9a581f153c14cb5371640cd62543b (patch)
tree9ac173df947df2aa34c246c778b33962afc59967 /mm/page_alloc.c
parent3643763834b935208b067db9f4a239aba9dbe28d (diff)
mm: use 'const char *' insted of 'char *' for reason in dump_page()
I tried to use 'dump_page(page, __func__)' for debugging, but it triggers warning: warning: passing argument 2 of `dump_page' discards `const' qualifier from pointer target type [enabled by default] Let's convert 'reason' to 'const char *' in dump_page() and friends: we shouldn't modify it anyway. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Dave Hansen <dave.hansen@linux.intel.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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 336ee925f756..73c25912c7c4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -295,7 +295,8 @@ static inline int bad_range(struct zone *zone, struct page *page)
295} 295}
296#endif 296#endif
297 297
298static void bad_page(struct page *page, char *reason, unsigned long bad_flags) 298static void bad_page(struct page *page, const char *reason,
299 unsigned long bad_flags)
299{ 300{
300 static unsigned long resume; 301 static unsigned long resume;
301 static unsigned long nr_shown; 302 static unsigned long nr_shown;
@@ -623,7 +624,7 @@ out:
623 624
624static inline int free_pages_check(struct page *page) 625static inline int free_pages_check(struct page *page)
625{ 626{
626 char *bad_reason = NULL; 627 const char *bad_reason = NULL;
627 unsigned long bad_flags = 0; 628 unsigned long bad_flags = 0;
628 629
629 if (unlikely(page_mapcount(page))) 630 if (unlikely(page_mapcount(page)))
@@ -859,7 +860,7 @@ static inline void expand(struct zone *zone, struct page *page,
859 */ 860 */
860static inline int check_new_page(struct page *page) 861static inline int check_new_page(struct page *page)
861{ 862{
862 char *bad_reason = NULL; 863 const char *bad_reason = NULL;
863 unsigned long bad_flags = 0; 864 unsigned long bad_flags = 0;
864 865
865 if (unlikely(page_mapcount(page))) 866 if (unlikely(page_mapcount(page)))
@@ -6545,7 +6546,8 @@ static void dump_page_flags(unsigned long flags)
6545 printk(")\n"); 6546 printk(")\n");
6546} 6547}
6547 6548
6548void dump_page_badflags(struct page *page, char *reason, unsigned long badflags) 6549void dump_page_badflags(struct page *page, const char *reason,
6550 unsigned long badflags)
6549{ 6551{
6550 printk(KERN_ALERT 6552 printk(KERN_ALERT
6551 "page:%p count:%d mapcount:%d mapping:%p index:%#lx\n", 6553 "page:%p count:%d mapcount:%d mapping:%p index:%#lx\n",
@@ -6561,7 +6563,7 @@ void dump_page_badflags(struct page *page, char *reason, unsigned long badflags)
6561 mem_cgroup_print_bad_page(page); 6563 mem_cgroup_print_bad_page(page);
6562} 6564}
6563 6565
6564void dump_page(struct page *page, char *reason) 6566void dump_page(struct page *page, const char *reason)
6565{ 6567{
6566 dump_page_badflags(page, reason, 0); 6568 dump_page_badflags(page, reason, 0);
6567} 6569}