]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
procfs-add-vmflags-field-in-smaps-output-v4-fix
authorAndrew Morton <akpm@linux-foundation.org>
Fri, 9 Nov 2012 03:05:03 +0000 (14:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Nov 2012 04:55:21 +0000 (15:55 +1100)
remove unneeded brakes per sfr, avoid using bloaty for_each_set_bit()

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/task_mmu.c

index 50a5f5f9cd96f34e2fe4d2e1cddc6c52521f0006..c0b4a044db2a9e4f9162ed61a217d1a2bc40309e 100644 (file)
@@ -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');
 }