From patchwork Tue Aug 2 10:41:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "baolex.ni" X-Patchwork-Id: 9271659 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 09F2D6088F for ; Tue, 9 Aug 2016 16:15:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE24827FC0 for ; Tue, 9 Aug 2016 16:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E2A5F283DF; 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 3B671283DF 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-00028X-FG; Tue, 09 Aug 2016 16:15:01 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bUXjC-00031E-3o for tpmdd-devel@lists.sourceforge.net; Tue, 02 Aug 2016 11:19:18 +0000 Received-SPF: fail (sog-mx-1.v43.ch3.sourceforge.com: domain of intel.com does not designate 192.55.52.88 as permitted sender) client-ip=192.55.52.88; envelope-from=baolex.ni@intel.com; helo=mga01.intel.com; Received: from mga01.intel.com ([192.55.52.88]) by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1bUXjB-0001To-BU for tpmdd-devel@lists.sourceforge.net; Tue, 02 Aug 2016 11:19:18 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 02 Aug 2016 04:19:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,459,1464678000"; d="scan'208"; a="1018186977" Received: from shsibuild003.sh.intel.com ([10.239.146.225]) by fmsmga001.fm.intel.com with ESMTP; 02 Aug 2016 04:19:07 -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:29 +0800 Message-Id: <20160802104129.21155-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 X-Headers-End: 1bUXjB-0001To-BU 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 0111/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-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index e2fa89c..d41261d 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -44,7 +44,7 @@ * with an extend to the selected _unused_ non-volatile pcr. */ static int tpm_suspend_pcr; -module_param_named(suspend_pcr, tpm_suspend_pcr, uint, 0644); +module_param_named(suspend_pcr, tpm_suspend_pcr, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); MODULE_PARM_DESC(suspend_pcr, "PCR to use for dummy writes to faciltate flush on suspend.");