From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756971AbcHBVRb (ORCPT ); Tue, 2 Aug 2016 17:17:31 -0400 Received: from imap.thunk.org ([74.207.234.97]:42966 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756812AbcHBVRP (ORCPT ); Tue, 2 Aug 2016 17:17:15 -0400 Date: Tue, 2 Aug 2016 17:17:02 -0400 From: "Theodore Ts'o" To: Baole Ni Cc: adilger.kernel@dilger.ca, david.vrabel@citrix.com, tomi.valkeinen@ti.com, m.chehab@samsung.com, gregkh@linuxfoundation.org, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, mhalcrow@google.com, kirill.shutemov@linux.intel.com, oneukum@suse.com Subject: Re: [PATCH 1038/1285] Replace numeric parameter like 0444 with macro Message-ID: <20160802211702.GA11745@thunk.org> Mail-Followup-To: Theodore Ts'o , Baole Ni , adilger.kernel@dilger.ca, david.vrabel@citrix.com, tomi.valkeinen@ti.com, m.chehab@samsung.com, gregkh@linuxfoundation.org, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, mhalcrow@google.com, kirill.shutemov@linux.intel.com, oneukum@suse.com References: <20160802121047.19315-1-baolex.ni@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160802121047.19315-1-baolex.ni@intel.com> User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 02, 2016 at 08:10: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. I actually find using the macros significantly **decrease* the readiability of the code. A quick glance at 0644 quickly tells you what the permissions are. Parsing S_IRUSR | S_IRGRP | S_IROTH takes longer, and is more error prone. NACK. - Ted