From a6fbbc0182ab4ff97483e46239ffc6b10ecd06c5 Mon Sep 17 00:00:00 2001 From: "Matthew Wilcox (Oracle)" Date: Mon, 2 Mar 2020 16:24:19 -0500 Subject: [PATCH] mm: Fix compilation warnings Nothing terribly interesting here. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/mmdebug.h | 2 +- mm/mmap.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index 48ed391c41d5..9d5852b07002 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h @@ -13,7 +13,7 @@ extern void dump_page(struct page *page, const char *reason); extern void __dump_page(struct page *page, const char *reason); void dump_vma(const struct vm_area_struct *vma); void dump_mm(const struct mm_struct *mm); -#define CONFIG_DEBUG_VM +#define CONFIG_DEBUG_VM 1 #ifdef CONFIG_DEBUG_VM #define VM_BUG_ON(cond) BUG_ON(cond) #define VM_BUG_ON_PAGE(cond, page) \ diff --git a/mm/mmap.c b/mm/mmap.c index fd8877861651..9d036e0fedc2 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -58,7 +58,7 @@ #include "internal.h" #define CONFIG_DEBUG_MAPLE_TREE -#define CONFIG_DEBUG_VM_RB +#define CONFIG_DEBUG_VM_RB 1 extern void mt_validate(struct maple_tree *mt); #ifndef arch_mmap_check @@ -386,6 +386,7 @@ static int browse_rb(struct mm_struct *mm) #if defined(CONFIG_DEBUG_MAPLE_TREE) extern void mt_dump(const struct maple_tree *mt); +#if 0 static void __vma_mt_dump(struct mm_struct *mm) { struct vm_area_struct *entry = NULL; @@ -402,8 +403,10 @@ static void __vma_mt_dump(struct mm_struct *mm) } rcu_read_unlock(); } -/* Validate the maple tree - * +#endif + +/* + * Validate the maple tree */ static void validate_mm_mt(struct mm_struct *mm, struct vm_area_struct *ignore) @@ -487,7 +490,7 @@ static void validate_mm(struct mm_struct *mm) while (vma) { struct anon_vma *anon_vma = vma->anon_vma; - struct anon_vma_chain *avc; +// struct anon_vma_chain *avc; // pr_cont("vma: %lu-%lu", vma->vm_start, vma->vm_end); if (anon_vma) { @@ -702,6 +705,7 @@ munmap_vma_range(struct mm_struct *mm, unsigned long start, unsigned long len, return 0; } +#if 0 /* Private * clean_overlaps() - Call do_munmap if there exists any mapping within @start * to @end. Sets @pprev to the previous entry or NULL if none exists. @@ -728,6 +732,7 @@ static int clean_overlaps(struct mm_struct *mm, unsigned long start, } return 0; } +#endif static unsigned long count_vma_pages_range(struct mm_struct *mm, unsigned long addr, unsigned long end) @@ -2362,7 +2367,7 @@ found_highest: { struct vm_area_struct *dv = mm->mmap; while (dv) { - printk("vma %px %llu-%llu\n", dv, dv->vm_start, dv->vm_end); + printk("vma %px %lu-%lu\n", dv, dv->vm_start, dv->vm_end); dv = dv->vm_next; } } -- 2.50.1