[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1522251891.12357.102.camel@perches.com>
Date: Wed, 28 Mar 2018 08:44:51 -0700
From: Joe Perches <joe@...ches.com>
To: Michal Hocko <mhocko@...nel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Hugh Dickins <hughd@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Minchan Kim <minchan@...nel.org>,
Nitin Gupta <ngupta@...are.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Seth Jennings <sjenning@...hat.com>,
Dan Streetman <ddstreet@...e.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH] mm: Use octal not symbolic permissions
On Wed, 2018-03-28 at 15:06 +0200, Michal Hocko wrote:
> On Mon 26-03-18 15:22:32, Joe Perches wrote:
> > mm/*.c files use symbolic and octal styles for permissions.
> >
> > Using octal and not symbolic permissions is preferred by many as more
> > readable.
> >
> > https://lkml.org/lkml/2016/8/2/1945
> >
> > Prefer the direct use of octal for permissions.
> >
> > Done using
> > $ scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace mm/*.c
> > and some typing.
> >
> > Before: $ git grep -P -w "0[0-7]{3,3}" mm | wc -l
> > 44
> > After: $ git grep -P -w "0[0-7]{3,3}" mm | wc -l
> > 86
>
> Ohh, I absolutely detest those symbolic names. I always have to check
> what they actually mean to be sure. Octal representation is quite
> natural to read. So for once I am really happy about such a clean up
> change.
>
> Btw. something like this should be quite easy to automate via
> coccinelle AFAIU.
checkpatch is currently better at this, for some
definition of better, than Coccinelle.
Julia and I had a discussion about it awhile ago.
https://lkml.org/lkml/2017/2/4/140
S_<FOO> groupings need to be combined and can
appear in arbitrary order.
Coccinelle would need the same octal addition in
some code path as checkpatch already has.
> > Miscellanea:
> >
> > o Whitespace neatening around these conversions.
> >
> > Signed-off-by: Joe Perches <joe@...ches.com>
>
> I hope I haven't overlooked any potential mismatch...
Doubtful as the conversion is completely automated.
Powered by blists - more mailing lists