From: Andrew Morton Date: Thu, 15 Nov 2012 02:38:39 +0000 (+1100) Subject: procfs-add-vmflags-field-in-smaps-output-v4-fix X-Git-Tag: next-20121115~2^2~56 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c5619c1c0db1fefa80e2bb03f3a2735fa373588a;p=karo-tx-linux.git procfs-add-vmflags-field-in-smaps-output-v4-fix remove unneeded brakes per sfr, avoid using bloaty for_each_set_bit() Cc: Cyrill Gorcunov Cc: Pavel Emelyanov Cc: Peter Zijlstra Cc: Stephen Rothwell Signed-off-by: Andrew Morton --- diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 1b1777a5fb54..81865bb98c53 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -535,7 +535,7 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) /* * In case if we meet a flag we don't know about. */ - [0 ... (BITS_PER_LONG-1)] = { "??" }, + [0 ... (BITS_PER_LONG-1)] = "??", [ilog2(VM_READ)] = "rd", [ilog2(VM_WRITE)] = "wr", @@ -568,10 +568,11 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) size_t i; seq_puts(m, "VmFlags: "); - for_each_set_bit(i, &vma->vm_flags, BITS_PER_LONG) { - seq_printf(m, "%c%c ", - mnemonics[i][0], - mnemonics[i][1]); + for (i = 0; i < BITS_PER_LONG; i++) { + if (vma->vm_flags & (1UL << i)) { + seq_printf(m, "%c%c ", + mnemonics[i][0], mnemonics[i][1]); + } } seq_putc(m, '\n'); }