From patchwork Tue Aug 2 10:41:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baole Ni X-Patchwork-Id: 657374 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s7zrp6kPkz9t1m for ; Wed, 10 Aug 2016 02:15:06 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bX9gD-00028d-HH; Tue, 09 Aug 2016 16:15:01 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bUXjE-0006jo-Lq for tpmdd-devel@lists.sourceforge.net; Tue, 02 Aug 2016 11:19:20 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of intel.com designates 192.55.52.93 as permitted sender) client-ip=192.55.52.93; envelope-from=baolex.ni@intel.com; helo=mga11.intel.com; Received: from mga11.intel.com ([192.55.52.93]) by sog-mx-3.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1bUXjD-0007UC-T4 for tpmdd-devel@lists.sourceforge.net; Tue, 02 Aug 2016 11:19:20 +0000 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 02 Aug 2016 04:19:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,459,1464678000"; d="scan'208";a="149288524" Received: from shsibuild003.sh.intel.com ([10.239.146.225]) by fmsmga004.fm.intel.com with ESMTP; 02 Aug 2016 04:19:12 -0700 From: Baole Ni To: peterhuewe@gmx.de, tpmdd@selhorst.net, jarkko.sakkinen@linux.intel.com, jgunthorpe@obsidianresearch.com, hpa@zytor.com, x86@kernel.org Date: Tue, 2 Aug 2016 18:41:34 +0800 Message-Id: <20160802104134.21221-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 X-Spam-Score: -1.9 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -1.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.9 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1bUXjD-0007UC-T4 X-Mailman-Approved-At: Tue, 09 Aug 2016 16:14:59 +0000 Cc: peter@korsgaard.com, lee.jones@linaro.org, linux-kernel@vger.kernel.org, baolex.ni@intel.com, tpmdd-devel@lists.sourceforge.net, chuansheng.liu@intel.com, jslaby@suse.cz Subject: [tpmdd-devel] [PATCH 0112/1285] Replace numeric parameter like 0444 with macro X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net 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 --- 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