[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20121024105641.1c5a27f34d53d9d3b1c57108@canb.auug.org.au>
Date: Wed, 24 Oct 2012 10:56:41 +1100
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Cyrill Gorcunov <gorcunov@...nvz.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Pavel Emelyanov <xemul@...allels.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [rfc 0/2] Introducing VmFlags field into smaps output
On Wed, 24 Oct 2012 00:32:54 +0200 Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:
>
> On Wed, 2012-10-24 at 01:59 +0400, Cyrill Gorcunov wrote:
> > [ilog2(VM_WRITE)] = { {'w', 'r'} },
>
> since we're being awfully positive about crazy late night ideas, how
> about something like:
>
> #define MNEM(_VM, _mn) [ilog2(_VM)] = {(const char [2]){_mn}}
>
> MNEM(VM_WRITE, "wr"),
The C standard and gcc allow you to initialise the 2 character array with
a (>=2 character) string literal with no casting, so
#define MNEM(_VM, _mn) [ilog2(_VM)] = {_mn}
should work.
[ and the the earlier version,
[ilog2(VM_READ)] = { "rd" },
etc, does work. ]
--
Cheers,
Stephen Rothwell sfr@...b.auug.org.au
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists