From: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
To: Baole Ni <baolex.ni@intel.com>
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
Date: Tue, 2 Aug 2016 13:38:07 +0200 [thread overview]
Message-ID: <20160802113807.GA3822@samfundet.no> (raw)
In-Reply-To: <20160802103407.14486-1-baolex.ni@intel.com>
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 <chuansheng.liu@intel.com>
> Signed-off-by: Baole Ni <baolex.ni@intel.com>
Fine by me.
Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
> ---
> 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
prev parent reply other threads:[~2016-08-02 11:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 10:34 [PATCH 0011/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-02 11:38 ` Hans-Christian Noren Egtvedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160802113807.GA3822@samfundet.no \
--to=egtvedt@samfundet.no \
--cc=baolex.ni@intel.com \
--cc=chuansheng.liu@intel.com \
--cc=hskinnemoen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox