public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Baole Ni <baolex.ni@intel.com>
To: gregkh@linuxfoundation.org, jslaby@suse.com,
	m.chehab@samsung.com, m.szyprowski@samsung.com,
	kyungmin.park@samsung.com, k.kozlowski@samsung.com
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	andriy.shevchenko@linux.intel.com, phillip.raffeck@fau.de,
	anton.wuerfel@fau.de, peter@hurleysoftware.com,
	yamada.masahiro@socionext.com,
	wan.ahmad.zainie.wan.mohamad@intel.com,
	mail@maciej.szmigiero.name, matwey@sai.msu.ru,
	chuansheng.liu@intel.com, baolex.ni@intel.com
Subject: [PATCH 0967/1285] Replace numeric parameter like 0444 with macro
Date: Tue,  2 Aug 2016 20:03:32 +0800	[thread overview]
Message-ID: <20160802120332.14527-1-baolex.ni@intel.com> (raw)

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>
---
 drivers/tty/serial/8250/8250_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 0fbd7c0..9309ec1 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1188,17 +1188,17 @@ module_exit(serial8250_exit);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Generic 8250/16x50 serial driver");
 
-module_param(share_irqs, uint, 0644);
+module_param(share_irqs, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices (unsafe)");
 
-module_param(nr_uarts, uint, 0644);
+module_param(nr_uarts, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")");
 
-module_param(skip_txen_test, uint, 0644);
+module_param(skip_txen_test, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skip_txen_test, "Skip checking for the TXEN bug at init time");
 
 #ifdef CONFIG_SERIAL_8250_RSA
-module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444);
+module_param_array(probe_rsa, ulong, &probe_rsa_count, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
 #endif
 MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
-- 
2.9.2

             reply	other threads:[~2016-08-02 12:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 12:03 Baole Ni [this message]
2016-08-02 13:19 ` [PATCH 0967/1285] Replace numeric parameter like 0444 with macro Matwey V. Kornilov
2016-08-02 13:34   ` Matwey V. Kornilov
2016-08-02 13:46     ` Greg KH

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=20160802120332.14527-1-baolex.ni@intel.com \
    --to=baolex.ni@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anton.wuerfel@fau.de \
    --cc=chuansheng.liu@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=m.szyprowski@samsung.com \
    --cc=mail@maciej.szmigiero.name \
    --cc=matwey@sai.msu.ru \
    --cc=peter@hurleysoftware.com \
    --cc=phillip.raffeck@fau.de \
    --cc=wan.ahmad.zainie.wan.mohamad@intel.com \
    --cc=yamada.masahiro@socionext.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox