Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1454586
| From | Lukas Wunner <lukas@wunner.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [Intel-gfx] [PATCH 0197/1285] Replace numeric parameter like 0444 with macro |
| Date | 2016-08-02 16:40 +0200 |
| Message-ID | <s1J1o-5FG-41@gated-at.bofh.it> (permalink) |
| References | <s1Iym-5ut-23@gated-at.bofh.it> <s1Iym-5ut-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Aug 02, 2016 at 02:37:37PM +0300, Ville Syrjälä wrote:
> On Tue, Aug 02, 2016 at 06:48:47PM +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>
> > ---
> > drivers/gpu/drm/i915/i915_params.c | 64 +++++++++++++++++++-------------------
> > 1 file changed, 32 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> > index 1779f02..7184e06 100644
> > --- a/drivers/gpu/drm/i915/i915_params.c
> > +++ b/drivers/gpu/drm/i915/i915_params.c
> > @@ -60,22 +60,22 @@ struct i915_params i915 __read_mostly = {
> > .inject_load_failure = 0,
> > };
> >
> > -module_param_named(modeset, i915.modeset, int, 0400);
> > +module_param_named(modeset, i915.modeset, int, S_IRUSR);
>
> At least I can't read those macros. Octal is much clearer IMO.
It's also easier to grep for, say, 644, rather than formulating a
regex with all possible ordering permutations of these macros.
Best regards,
Lukas
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [Intel-gfx] [PATCH 0197/1285] Replace numeric parameter like 0444 with macro Lukas Wunner <lukas@wunner.de> - 2016-08-02 16:40 +0200
csiph-web