All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baole Ni <baolex.ni@intel.com>
To: peterhuewe@gmx.de, tpmdd@selhorst.net,
	jarkko.sakkinen@linux.intel.com, jgunthorpe@obsidianresearch.com,
	hpa@zytor.com, x86@kernel.org
Cc: tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	chuansheng.liu@intel.com, baolex.ni@intel.com, jslaby@suse.cz,
	peter@korsgaard.com, lee.jones@linaro.org
Subject: [PATCH 0112/1285] Replace numeric parameter like 0444 with macro
Date: Tue,  2 Aug 2016 18:41:34 +0800	[thread overview]
Message-ID: <20160802104134.21221-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/char/tpm/tpm_tis.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index a507006..d9ab2f6 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -294,7 +294,7 @@ out:
 }
 
 static bool itpm;
-module_param(itpm, bool, 0444);
+module_param(itpm, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)");
 
 /*
@@ -645,7 +645,7 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
 }
 
 static bool interrupts = true;
-module_param(interrupts, bool, 0444);
+module_param(interrupts, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(interrupts, "Enable interrupts");
 
 static void tpm_tis_remove(struct tpm_chip *chip)
@@ -921,7 +921,7 @@ static struct pnp_driver tis_pnp_driver = {
 
 #define TIS_HID_USR_IDX sizeof(tpm_pnp_tbl)/sizeof(struct pnp_device_id) -2
 module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
-		    sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
+		    sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
 
 #ifdef CONFIG_ACPI
@@ -1060,7 +1060,7 @@ static struct platform_driver tis_drv = {
 
 static bool force;
 #ifdef CONFIG_X86
-module_param(force, bool, 0444);
+module_param(force, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry");
 #endif
 
-- 
2.9.2

                 reply	other threads:[~2016-08-02 11:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160802104134.21221-1-baolex.ni@intel.com \
    --to=baolex.ni@intel.com \
    --cc=chuansheng.liu@intel.com \
    --cc=hpa@zytor.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=jslaby@suse.cz \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@korsgaard.com \
    --cc=peterhuewe@gmx.de \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@selhorst.net \
    --cc=x86@kernel.org \
    /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.