From: Rusty Russell <rusty@rustcorp.com.au>
To: Baole Ni <baolex.ni@intel.com>,
rpurdie@rpsys.net, j.anaszewski@samsung.com,
hal.rosenstock@gmail.com, dledford@redhat.com,
sean.hefty@intel.com, bp@alien8.de
Cc: lguest@lists.ozlabs.org, linux-kernel@vger.kernel.org,
mingo@kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com
Subject: Re: [PATCH 0309/1285] Replace numeric parameter like 0444 with macro
Date: Wed, 03 Aug 2016 12:07:19 +0930 [thread overview]
Message-ID: <87h9b2y3vk.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20160802105854.2073-1-baolex.ni@intel.com>
Baole Ni <baolex.ni@intel.com> 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.
I find the numbers far, far more readable.
Cheers,
Rusty.
> /* Allow Guests to use a non-128 (ie. non-Linux) syscall trap. */
> static unsigned int syscall_vector = IA32_SYSCALL_VECTOR;
> -module_param(syscall_vector, uint, 0444);
> +module_param(syscall_vector, uint, S_IRUSR | S_IRGRP | S_IROTH);
>
> /* The address of the interrupt handler is split into two bits: */
> static unsigned long idt_address(u32 lo, u32 hi)
> --
> 2.9.2
prev parent reply other threads:[~2016-08-03 2:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 10:58 [PATCH 0309/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-03 2:37 ` Rusty Russell [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=87h9b2y3vk.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=baolex.ni@intel.com \
--cc=bp@alien8.de \
--cc=chuansheng.liu@intel.com \
--cc=dledford@redhat.com \
--cc=hal.rosenstock@gmail.com \
--cc=j.anaszewski@samsung.com \
--cc=lguest@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rpurdie@rpsys.net \
--cc=sean.hefty@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.