Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573675

Re: Staging: speakup - syle fix permissions to octal

From Julia Lawall <julia.lawall@lip6.fr>
Newsgroups linux.kernel
Subject Re: Staging: speakup - syle fix permissions to octal
Date 2017-02-04 15:30 +0100
Message-ID <t79vI-1Gb-13@gated-at.bofh.it> (permalink)
References <t4umZ-66A-1@gated-at.bofh.it> <t70sq-3HZ-7@gated-at.bofh.it> <t72Xf-5zF-3@gated-at.bofh.it> <t79vH-1Gb-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On Sat, 4 Feb 2017, Guenter Roeck wrote:

> On 02/03/2017 11:27 PM, Joe Perches wrote:
> > (adding Julia Lawall)
> >
> > On Fri, 2017-02-03 at 20:44 -0800, Guenter Roeck wrote:
> > > On Sat, Jan 28, 2017 at 07:05:09PM +1300, Derek Robson wrote:
> > > > A style fix across whole driver.
> > > > changed permissions to octal style, found using checkpatch
> > > >
> > > > Signed-off-by: Derek Robson <robsonde@gmail.com>
> > >
> > > FWIW, I think changes like this are best done using coccinelle.
> >
> > I think checkpatch does it reasonably well.
> >
> > Julia?  Can coccinelle do this?
> >
> > I believe cocinelle doesn't handle the substitution
> > and octal addition very well when multiple flags
> > are used.
> >
>
> Why not ? Seems to be quite simple. One just has to list all the variants
> being used in the rule.
>
> > > That ensures that the results can be reproduced and are well defined.
> > > As it is, someone will have to check each line of your patches to ensure
> > > that the conversion is correct.
> > >
> > > It would also ensure (hopefully) that we don't end up with constructs
> > > such as
> > >
> > > > -#define USER_R (S_IFREG|S_IRUGO)
> > > > -#define USER_W (S_IFREG|S_IWUGO)
> > > > +#define USER_R (S_IFREG|0444)
> > > > +#define USER_W (S_IFREG|0666)
> > >
> > > which really defeat the purpose of the whole exercise.
> >
> > Why do you think mixing file specific attributes
> > with octal permissions is a bad thing?
> >
>
> Just an assumption. My bad. Ultimately, what I think doesn't really
> matter, though - because what I think is that the whole "use octals"
> is a bad idea to start with.

I don't think I have received yet the message that this is referring to.
But I don't see a problem for Coccinelle a priori.  If there are things
that need to be added together, as long as they are explicit constants,
that can be done in python or ocaml.

julia

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Staging: speakup - syle fix permissions to octal Joe Perches <joe@perches.com> - 2017-02-04 08:30 +0100
  Re: Staging: speakup - syle fix permissions to octal Guenter Roeck <linux@roeck-us.net> - 2017-02-04 15:30 +0100
    Re: Staging: speakup - syle fix permissions to octal Julia Lawall <julia.lawall@lip6.fr> - 2017-02-04 15:30 +0100
      Re: Staging: speakup - syle fix permissions to octal Guenter Roeck <linux@roeck-us.net> - 2017-02-04 16:20 +0100
        Re: Staging: speakup - syle fix permissions to octal Julia Lawall <julia.lawall@lip6.fr> - 2017-02-04 16:30 +0100
  Re: Staging: speakup - syle fix permissions to octal Julia Lawall <julia.lawall@lip6.fr> - 2017-02-04 19:20 +0100
    Re: Staging: speakup - syle fix permissions to octal Joe Perches <joe@perches.com> - 2017-02-04 19:40 +0100
      Re: Staging: speakup - syle fix permissions to octal Julia Lawall <julia.lawall@lip6.fr> - 2017-02-04 20:30 +0100
        Re: Staging: speakup - syle fix permissions to octal Joe Perches <joe@perches.com> - 2017-02-04 20:40 +0100

csiph-web