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: Baole Ni X-Patchwork-Id: 657375 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 3s7zrq1Yzyz9t22 for ; Wed, 10 Aug 2016 02:15:07 +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-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-Spam-Score: 1.1 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 4.0 SPF_CHECK_FAIL SPF reports sender host as NOT permitted to send mails from -1.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) -2.6 AWL AWL: Adjusted score from AWL reputation of From: address 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 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.");