linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Please don't replace numeric parameter like 0444 with macro
@ 2016-08-02 20:58 Linus Torvalds
  2016-08-02 21:53 ` Rob Landley
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Linus Torvalds @ 2016-08-02 20:58 UTC (permalink / raw)
  To: Pavel Machek, Greg Kroah-Hartman, Heiko Carstens
  Cc: Baole Ni, Russell King - ARM Linux, linux-arm-kernel,
	Linux Kernel Mailing List, chuansheng.liu

[ So I answered similarly to another patch, but I'll just re-iterate
and change the subject line so that it stands out a bit from the
millions of actual patches ]

On Tue, Aug 2, 2016 at 1:42 PM, Pavel Machek <pavel@ucw.cz> wrote:
>
> Everyone knows what 0644 is, but noone can read S_IRUSR | S_IWUSR |
> S_IRCRP | S_IROTH (*). Please don't do this.

Absolutely. It's *much* easier to parse and understand the octal
numbers, while the symbolic macro names are just random line noise and
hard as hell to understand. You really have to think about it.

So we should rather go the other way: convert existing bad symbolic
permission bit macro use to just use the octal numbers.

The symbolic names are good for the *other* bits (ie sticky bit, and
the inode mode _type_ numbers etc), but for the permission bits, the
symbolic names are just insane crap. Nobody sane should ever use them.
Not in the kernel, not in user space.

           Linus

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-08-15 16:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 20:58 Please don't replace numeric parameter like 0444 with macro Linus Torvalds
2016-08-02 21:53 ` Rob Landley
2016-08-02 23:39 ` [PATCH] checkpatch: Look for symbolic permissions and suggest octal instead Joe Perches
2016-08-03  0:15   ` Al Viro
2016-08-03  0:30     ` Joe Perches
2016-08-15 16:38   ` Joe Perches
2016-08-03  0:42 ` Please don't replace numeric parameter like 0444 with macro Al Viro
2016-08-03  8:07   ` Konstantin Khlebnikov
2016-08-03  8:30     ` Richard Weinberger
2016-08-03  8:11 ` [PATCH] Add file permission mode helpers Ingo Molnar
2016-08-03  8:28   ` Greg Kroah-Hartman
2016-08-03  8:39     ` Ingo Molnar
2016-08-03  9:21       ` Willy Tarreau
2016-08-03  9:53     ` Marcel Holtmann
2016-08-03 15:49   ` Joe Perches
2016-08-03 16:38   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).