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


Groups > linux.kernel > #1455364

Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with macro

From Tejun Heo <tj@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with macro
Date 2016-08-02 20:40 +0200
Message-ID <s1MLE-8fV-21@gated-at.bofh.it> (permalink)
References <s1FTR-3Ey-57@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,

On Tue, Aug 02, 2016 at 06:37:59PM +0800, Baole Ni wrote:
> I find that the developers often just specified the numeric value
> when calling a macro which is defined with a parameter for access permission.
> As we know, these numeric value for access permission have had the corresponding macro,
> and that using macro can improve the robustness and readability of the code,
> thus, I suggest replacing the numeric parameter with the macro.
> 
> Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
> Signed-off-by: Baole Ni <baolex.ni@intel.com>

I don't see the point.  This actually makes code harder to read.
Sure, in general, we want to avoid using magic raw numbers but the
octal permission numbers are pretty much canonical.  These conversions
are pure noises.

Nacked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0063/1285] Replace numeric parameter like 0444 with macro Baole Ni <baolex.ni@intel.com> - 2016-08-02 13:20 +0200
  Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with macro Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-08-02 13:40 +0200
    Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with macro Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-08-02 14:40 +0200
      Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with macro Steven Rostedt <rostedt@goodmis.org> - 2016-08-02 15:30 +0200
        Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with macro Marcel Holtmann <marcel@holtmann.org> - 2016-08-02 16:00 +0200
  Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with  macro David Miller <davem@davemloft.net> - 2016-08-02 20:40 +0200
  Re: [PATCH 0063/1285] Replace numeric parameter like 0444 with macro Tejun Heo <tj@kernel.org> - 2016-08-02 20:40 +0200

csiph-web