[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20121024204746.8a8c0fa14b6495b5d5013db4@canb.auug.org.au>
Date: Wed, 24 Oct 2012 20:47:46 +1100
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Cyrill Gorcunov <gorcunov@...nvz.org>
Cc: akpm@...ux-foundation.org, a.p.zijlstra@...llo.nl,
xemul@...allels.com, LKML <linux-kernel@...r.kernel.org>
Subject: Re: + procfs-add-vmflags-field-in-smaps-output-v3-fix-2.patch added
to -mm tree
Hi Cyrill,
On Wed, 24 Oct 2012 12:45:15 +0400 Cyrill Gorcunov <gorcunov@...nvz.org> wrote:
>
> static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
> {
> +#define __VM_FLAG(_f, _s) [ilog2(_f)] = {(const char [2]){_s}}
I really don't think you need the cast (and it may hide bad usages) or
the second set of braces. Thus:
#define __VM_FLAG(_f, _s) [ilog2(_f)] = {_s}
> +
> /*
> * Don't forget to update Documentation/ on changes.
> */
> @@ -491,46 +493,49 @@ static void show_smap_vma_flags(struct s
> /*
> * In case if we meet a flag we don't know about.
> */
> - [0 ... (BITS_PER_LONG-1)] = { {'?', '?'} },
> + [0 ... (BITS_PER_LONG-1)] = { (const char [2]){"??"} },
And here.
Further is there any reason for the struct?
#define __VM_FLAG(_f, _s) [ilog2(_f)] = _s
static const char mnemonics[BITS_PER_LONG][2] = {
...
};
> seq_puts(m, "VmFlags: ");
> for (i = 0; i < BITS_PER_LONG; i++) {
> - if (vma->vm_flags & (1 << i))
> + if (vma->vm_flags & (1ul << i)) {
> seq_printf(m, "%c%c ",
> mnemonics[i].l[0],
> mnemonics[i].l[1]);
mnemonics[i][0], mnemonics[i][1]
/me looks for another bike shed :-)
--
Cheers,
Stephen Rothwell sfr@...b.auug.org.au
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists