[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e0bd8128-b578-bdc5-a599-51b81bbba438@roeck-us.net>
Date: Sat, 4 Feb 2017 06:22:49 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Joe Perches <joe@...ches.com>, Derek Robson <robsonde@...il.com>,
Julia Lawall <julia.lawall@...6.fr>
Cc: w.d.hubbs@...il.com, chris@...-brannons.com, kirk@...sers.ca,
samuel.thibault@...-lyon.org, gregkh@...uxfoundation.org,
shraddha.6596@...il.com, alan@...ux.intel.com, shiva@...ev.nl,
amitoj1606@...il.com, amsfield22@...il.com, bhumirks@...il.com,
waltfeasel@...il.com, speakup@...ux-speakup.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: Staging: speakup - syle fix permissions to octal
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@...il.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.
Guenter
Powered by blists - more mailing lists