From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756847AbcHBOhz (ORCPT ); Tue, 2 Aug 2016 10:37:55 -0400 Received: from mailout1.hostsharing.net ([83.223.95.204]:39649 "EHLO mailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965453AbcHBOhM (ORCPT ); Tue, 2 Aug 2016 10:37:12 -0400 Date: Tue, 2 Aug 2016 16:27:23 +0200 From: Lukas Wunner To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Cc: Baole Ni , wuninsu@gmail.com, k.kozlowski@samsung.com, treding@nvidia.com, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, kgene@kernel.org, bp@alien8.de, dri-devel@lists.freedesktop.org, dougthompson@xmission.com, daniel.vetter@intel.com, chuansheng.liu@intel.com Subject: Re: [Intel-gfx] [PATCH 0197/1285] Replace numeric parameter like 0444 with macro Message-ID: <20160802142723.GA3978@wunner.de> References: <20160802104847.26886-1-baolex.ni@intel.com> <20160802113737.GT4329@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160802113737.GT4329@intel.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Signed-off-by: Baole Ni > > --- > > 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