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


Groups > linux.kernel > #1573738

Re: Staging: speakup - syle fix permissions to octal

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: Staging: speakup - syle fix permissions to octal
Date 2017-02-04 20:40 +0100
Message-ID <t7elH-564-5@gated-at.bofh.it> (permalink)
References (1 earlier) <t70sq-3HZ-7@gated-at.bofh.it> <t72Xf-5zF-3@gated-at.bofh.it> <t7d6h-4jT-17@gated-at.bofh.it> <t7dpE-4s6-13@gated-at.bofh.it> <t7ec1-529-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, 2017-02-04 at 20:24 +0100, Julia Lawall wrote:
> 
> On Sat, 4 Feb 2017, Joe Perches wrote:
> 
> > On Sat, 2017-02-04 at 19:10 +0100, Julia Lawall wrote:
> > > 
> > > On Fri, 3 Feb 2017, 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.
> > > 
> > > OK, finally received.  I think that Guenter's solution is a good one,
> > > because the rule-writer knows better than Coccinelle what people find to
> > > be intelligible.
> > 
> > If it's written in python, I don't see how that's
> > particularly different than being written in perl,
> > but coccinelle could certainly handle expressions
> > on multiple lines of these or'd constants better.
> 
> Well, the python would only be needed if there was a need for actual
> calculations.  Should S_IRGRP | S_IWGRP become 0060?

Yes.

> > Are there any than span 2 or more lines?
> > I didn't see one with a casual grep.
> > 
> > Does coccinelle handle arbitrary ordering of these
> > constants in a form like Guenter suggests or does
> > each possible ordered sequence need to be written?
> 
> There is the following isomorphism:
> 
> X | Y => Y | X
> 
> But that only works when the associativity is right.
> 
> A | B | C is (A | B) | C, so the B and C won't exchange with each other.
> One can also write eg
> 
> A | ... | B
> 
> which gives more fexibility.  I'm not sure to what extent that works when
> there are changes, though.

The perl code doesn't care about the ordering
but it doesn't handle the A | ... | B case.

Back to linux.kernel | Previous | NextPrevious 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