From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756228AbcHBLj2 (ORCPT ); Tue, 2 Aug 2016 07:39:28 -0400 Received: from cassarossa.samfundet.no ([193.35.52.29]:45809 "EHLO cassarossa.samfundet.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756141AbcHBLis (ORCPT ); Tue, 2 Aug 2016 07:38:48 -0400 Date: Tue, 2 Aug 2016 13:38:07 +0200 From: Hans-Christian Noren Egtvedt To: Baole Ni Cc: hskinnemoen@gmail.com, robert.jarzmik@free.fr, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, chuansheng.liu@intel.com Subject: Re: [PATCH 0011/1285] Replace numeric parameter like 0444 with macro Message-ID: <20160802113807.GA3822@samfundet.no> References: <20160802103407.14486-1-baolex.ni@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160802103407.14486-1-baolex.ni@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Around Tue 02 Aug 2016 18:34:07 +0800 or thereabout, 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 Fine by me. Acked-by: Hans-Christian Noren Egtvedt > --- > arch/avr32/kernel/cpu.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c > index 0341ae2..c4c96af 100644 > --- a/arch/avr32/kernel/cpu.c > +++ b/arch/avr32/kernel/cpu.c > @@ -171,12 +171,12 @@ static ssize_t store_pcenable(struct device *dev, > return count; > } > > -static DEVICE_ATTR(pc0event, 0600, show_pc0event, store_pc0event); > -static DEVICE_ATTR(pc0count, 0600, show_pc0count, store_pc0count); > -static DEVICE_ATTR(pc1event, 0600, show_pc1event, store_pc1event); > -static DEVICE_ATTR(pc1count, 0600, show_pc1count, store_pc1count); > -static DEVICE_ATTR(pccycles, 0600, show_pccycles, store_pccycles); > -static DEVICE_ATTR(pcenable, 0600, show_pcenable, store_pcenable); > +static DEVICE_ATTR(pc0event, S_IRUSR | S_IWUSR, show_pc0event, store_pc0event); > +static DEVICE_ATTR(pc0count, S_IRUSR | S_IWUSR, show_pc0count, store_pc0count); > +static DEVICE_ATTR(pc1event, S_IRUSR | S_IWUSR, show_pc1event, store_pc1event); > +static DEVICE_ATTR(pc1count, S_IRUSR | S_IWUSR, show_pc1count, store_pc1count); > +static DEVICE_ATTR(pccycles, S_IRUSR | S_IWUSR, show_pccycles, store_pccycles); > +static DEVICE_ATTR(pcenable, S_IRUSR | S_IWUSR, show_pcenable, store_pcenable); > > #endif /* CONFIG_PERFORMANCE_COUNTERS */ -- Best regards, Hans-Christian Noren Egtvedt