From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
Guenter Roeck <linux@roeck-us.net>,
Derek Robson <robsonde@gmail.com>,
w.d.hubbs@gmail.com, chris@the-brannons.com, kirk@reisers.ca,
samuel.thibault@ens-lyon.org, gregkh@linuxfoundation.org,
shraddha.6596@gmail.com, alan@linux.intel.com, shiva@exdev.nl,
amitoj1606@gmail.com, amsfield22@gmail.com, bhumirks@gmail.com,
waltfeasel@gmail.com, speakup@linux-speakup.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: Staging: speakup - syle fix permissions to octal
Date: Sat, 4 Feb 2017 20:24:38 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1702042018100.1963@hadrien> (raw)
In-Reply-To: <1486233168.22276.88.camel@perches.com>
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?
>
> 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.
julia
> just fyi:
>
> "S_IRWXU" => 0700
> "S_IRUSR" => 0400
> "S_IWUSR" => 0200
> "S_IXUSR" => 0100
> "S_IRWXG" => 0070
> "S_IRGRP" => 0040
> "S_IWGRP" => 0020
> "S_IXGRP" => 0010
> "S_IRWXO" => 0007
> "S_IROTH" => 0004
> "S_IWOTH" => 0002
> "S_IXOTH" => 0001
> "S_IRWXUGO" => 0777
> "S_IRUGO" => 0444
> "S_IWUGO" => 0222
> "S_IXUGO" => 0111
next prev parent reply other threads:[~2017-02-04 19:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-28 6:05 [PATCH] " Derek Robson
2017-01-28 6:14 ` Joe Perches
2017-02-04 4:44 ` Guenter Roeck
2017-02-04 7:27 ` Joe Perches
2017-02-04 14:22 ` Guenter Roeck
2017-02-04 14:29 ` Julia Lawall
2017-02-04 15:17 ` Guenter Roeck
2017-02-04 15:25 ` Julia Lawall
2017-02-04 18:10 ` Julia Lawall
2017-02-04 18:32 ` Joe Perches
2017-02-04 19:24 ` Julia Lawall [this message]
2017-02-04 19:30 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1702042018100.1963@hadrien \
--to=julia.lawall@lip6.fr \
--cc=alan@linux.intel.com \
--cc=amitoj1606@gmail.com \
--cc=amsfield22@gmail.com \
--cc=bhumirks@gmail.com \
--cc=chris@the-brannons.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=kirk@reisers.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robsonde@gmail.com \
--cc=samuel.thibault@ens-lyon.org \
--cc=shiva@exdev.nl \
--cc=shraddha.6596@gmail.com \
--cc=speakup@linux-speakup.org \
--cc=w.d.hubbs@gmail.com \
--cc=waltfeasel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome