[PATCH] mm, debug: introduce-vm_bug_on_mm-fix-fix.patch

From: Michal Hocko
Date: Tue Sep 23 2014 - 06:55:18 EST


dump_mm will fail to compile if the last config options are not defined.
I have hit the following (trimmed down) while doing randconfig:
mm/debug.c: In function âdump_mmâ:
mm/debug.c:197:3: error: expected â)â before âmmâ
mm, mm->mmap, mm->vmacache_seqnum, mm->task_size,
^
include/linux/printk.h:221:21: note: in definition of macro âpr_fmtâ
#define pr_fmt(fmt) fmt
^
mm/debug.c:169:2: note: in expansion of macro âpr_emergâ
pr_emerg("mm %p mmap %p seqnum %d task_size %lu\n"

with neither CONFIG_COMPACTION nor CONFIG_NUMA_BALANCING set because
the last format string portion will not have a comma separating other
parameters. There is also a trailing comma at the end of parameters
list.

Fix this by being careful to place commas before mm as the first known
unconditional paramter after formatting patch and also before the last
conditional parameters rather at their end.

Signed-off-by: Michal Hocko <mhocko@xxxxxxx>
---
mm/debug.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/debug.c b/mm/debug.c
index 63aba9dcfb4e..d21b7e6b4bbc 100644
--- a/mm/debug.c
+++ b/mm/debug.c
@@ -192,9 +192,9 @@ void dump_mm(const struct mm_struct *mm)
"numa_next_scan %lu numa_scan_offset %lu numa_scan_seq %d\n"
#endif
#if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
- "tlb_flush_pending %d\n",
+ "tlb_flush_pending %d\n"
#endif
- mm, mm->mmap, mm->vmacache_seqnum, mm->task_size,
+ , mm, mm->mmap, mm->vmacache_seqnum, mm->task_size,
#ifdef CONFIG_MMU
mm->get_unmapped_area,
#endif
@@ -215,15 +215,15 @@ void dump_mm(const struct mm_struct *mm)
#ifdef CONFIG_MEMCG
mm->owner,
#endif
- mm->exe_file,
+ mm->exe_file
#ifdef CONFIG_MMU_NOTIFIER
- mm->mmu_notifier_mm,
+ , mm->mmu_notifier_mm
#endif
#ifdef CONFIG_NUMA_BALANCING
- mm->numa_next_scan, mm->numa_scan_offset, mm->numa_scan_seq,
+ , mm->numa_next_scan, mm->numa_scan_offset, mm->numa_scan_seq
#endif
#if defined(CONFIG_NUMA_BALANCING) || defined(CONFIG_COMPACTION)
- mm->tlb_flush_pending
+ , mm->tlb_flush_pending
#endif
);

--
2.1.0

--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/