lkml.org 
[lkml]   [2018]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm: Use octal not symbolic permissions
From
Date
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@perches.com>
>
> I hope I haven't overlooked any potential mismatch...

Doubtful as the conversion is completely automated.

\
 
 \ /
  Last update: 2018-03-28 17:45    [W:0.070 / U:20.932 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site