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: "baolex.ni" X-Patchwork-Id: 9271657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DF46D60871 for ; Tue, 9 Aug 2016 16:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D12EA2842A for ; Tue, 9 Aug 2016 16:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C364C2842B; Tue, 9 Aug 2016 16:15:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 386B62833F for ; Tue, 9 Aug 2016 16:15:02 +0000 (UTC) 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-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 X-Virus-Scanned: ClamAV using ClamSMTP 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