All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Pavel Machek <pavel@ucw.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Baole Ni <baolex.ni@intel.com>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	chuansheng.liu@intel.com
Subject: Re: Please don't replace numeric parameter like 0444 with macro
Date: Tue, 2 Aug 2016 16:53:11 -0500	[thread overview]
Message-ID: <8f441710-caa7-b746-0556-bde89dea52f2@landley.net> (raw)
In-Reply-To: <CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com>

On 08/02/2016 03:58 PM, Linus Torvalds wrote:
> [ 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.

Posix even specifies the numeric value for each macro in the chmod
command's extended description:

  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html

Rob

WARNING: multiple messages have this Message-ID (diff)
From: rob@landley.net (Rob Landley)
To: linux-arm-kernel@lists.infradead.org
Subject: Please don't replace numeric parameter like 0444 with macro
Date: Tue, 2 Aug 2016 16:53:11 -0500	[thread overview]
Message-ID: <8f441710-caa7-b746-0556-bde89dea52f2@landley.net> (raw)
In-Reply-To: <CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com>

On 08/02/2016 03:58 PM, Linus Torvalds wrote:
> [ 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.

Posix even specifies the numeric value for each macro in the chmod
command's extended description:

  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/chmod.html

Rob

  reply	other threads:[~2016-08-02 21:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 20:58 Please don't replace numeric parameter like 0444 with macro Linus Torvalds
2016-08-02 20:58 ` Linus Torvalds
2016-08-02 21:53 ` Rob Landley [this message]
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  0:42   ` Al Viro
2016-08-03  8:07   ` Konstantin Khlebnikov
2016-08-03  8:07     ` Konstantin Khlebnikov
2016-08-03  8:30     ` Richard Weinberger
2016-08-03  8:30       ` Richard Weinberger
2016-08-03  8:11 ` [PATCH] Add file permission mode helpers Ingo Molnar
2016-08-03  8:11   ` Ingo Molnar
2016-08-03  8:28   ` Greg Kroah-Hartman
2016-08-03  8:28     ` Greg Kroah-Hartman
2016-08-03  8:39     ` Ingo Molnar
2016-08-03  8:39       ` Ingo Molnar
2016-08-03  9:21       ` Willy Tarreau
2016-08-03  9:21         ` Willy Tarreau
2016-08-03  9:53     ` Marcel Holtmann
2016-08-03  9:53       ` Marcel Holtmann
2016-08-03 15:49   ` Joe Perches
2016-08-03 15:49     ` Joe Perches
2016-08-03 16:38   ` Pavel Machek
2016-08-03 16:38     ` Pavel Machek

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=8f441710-caa7-b746-0556-bde89dea52f2@landley.net \
    --to=rob@landley.net \
    --cc=baolex.ni@intel.com \
    --cc=chuansheng.liu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=pavel@ucw.cz \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.