From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935297AbcHBQN3 (ORCPT ); Tue, 2 Aug 2016 12:13:29 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:45801 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935076AbcHBQNE (ORCPT ); Tue, 2 Aug 2016 12:13:04 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Baole Ni Cc: pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, davem@davemloft.net, jmorris@namei.org, yoshfuji@linux-ipv6.org, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, johunt@akamai.com, vpai@akamai.com, chuansheng.liu@intel.com, aryabinin@virtuozzo.com References: <20160802121749.24461-1-baolex.ni@intel.com> Date: Tue, 02 Aug 2016 09:29:27 -0500 In-Reply-To: <20160802121749.24461-1-baolex.ni@intel.com> (Baole Ni's message of "Tue, 2 Aug 2016 20:17:49 +0800") Message-ID: <8737mns0qg.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1bUatz-0002Tj-AS;;;mid=<8737mns0qg.fsf@x220.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=67.3.204.119;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX180RIt9pLCCPQCrl2xs61en9vxPycPqjEs= X-SA-Exim-Connect-IP: 67.3.204.119 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.1 XMSolicitRefs_0 Weightloss drug X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Baole Ni X-Spam-Relay-Country: X-Spam-Timing: total 867 ms - load_scoreonly_sql: 0.03 (0.0%), signal_user_changed: 2.9 (0.3%), b_tie_ro: 1.98 (0.2%), parse: 1.07 (0.1%), extract_message_metadata: 18 (2.0%), get_uri_detail_list: 1.95 (0.2%), tests_pri_-1000: 9 (1.0%), tests_pri_-950: 1.16 (0.1%), tests_pri_-900: 1.07 (0.1%), tests_pri_-400: 27 (3.1%), check_bayes: 25 (2.9%), b_tokenize: 10 (1.1%), b_tok_get_all: 7 (0.9%), b_comp_prob: 2.8 (0.3%), b_tok_touch_all: 2.6 (0.3%), b_finish: 0.72 (0.1%), tests_pri_0: 446 (51.5%), check_dkim_signature: 0.44 (0.1%), check_dkim_adsp: 2.9 (0.3%), tests_pri_500: 358 (41.3%), poll_dns_idle: 350 (40.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 1115/1285] Replace numeric parameter like 0444 with macro X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Baole Ni writes: > 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. *Scratches my head* The permissions are not 0444 below. With 1285 patches I wonder how many typos you may have made. Was this generated by a script? Eric > Signed-off-by: Chuansheng Liu > Signed-off-by: Baole Ni > --- > net/netfilter/ipset/ip_set_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c > index a748b0c..b6c060d3 100644 > --- a/net/netfilter/ipset/ip_set_core.c > +++ b/net/netfilter/ipset/ip_set_core.c > @@ -48,7 +48,7 @@ static inline struct ip_set_net *ip_set_pernet(struct net *net) > > static unsigned int max_sets; > > -module_param(max_sets, int, 0600); > +module_param(max_sets, int, S_IRUSR | S_IWUSR); > MODULE_PARM_DESC(max_sets, "maximal number of sets"); > MODULE_LICENSE("GPL"); > MODULE_AUTHOR("Jozsef Kadlecsik ");