From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968210AbcHBRyU (ORCPT ); Tue, 2 Aug 2016 13:54:20 -0400 Received: from smtprelay0039.hostedemail.com ([216.40.44.39]:54548 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936039AbcHBRxE (ORCPT ); Tue, 2 Aug 2016 13:53:04 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:2901:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3874:4321:5007:9108:10004:10400:10848:11026:11232:11658:11914:12517:12519:12740:13069:13311:13357:13439:14659:14721:21080:21324:21433:30012:30054:30064:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: cake14_3171c87213240 X-Filterd-Recvd-Size: 1709 Message-ID: <1470160338.3998.193.camel@perches.com> Subject: Re: [PATCH 0001/1285] Replace numeric parameter like 0444 with macro From: Joe Perches To: Pavel Machek , Baole Ni Cc: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com Date: Tue, 02 Aug 2016 10:52:18 -0700 In-Reply-To: <20160802174253.GA4628@amd> References: <20160802103322.13810-1-baolex.ni@intel.com> <20160802174253.GA4628@amd> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-08-02 at 19:42 +0200, Pavel Machek 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. > > > > -core_param(no_bL_switcher, no_bL_switcher, bool, 0644); > > +core_param(no_bL_switcher, no_bL_switcher, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); > Everyone knows what 0644 is, but noone can read S_IRUSR | S_IWUSR | > S_IRCRP | S_IROTH (*). Please don't do this. Perhaps this conversion is best done in reverse with most all of the S_[A-Z]{5,5} uses converted to octal.