From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965706AbcHBMyB (ORCPT ); Tue, 2 Aug 2016 08:54:01 -0400 Received: from mga01.intel.com ([192.55.52.88]:42174 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965652AbcHBMx2 (ORCPT ); Tue, 2 Aug 2016 08:53:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1018233051" From: Baole Ni To: anton@enomsg.org, ccross@android.com, keescook@chromium.org, tony.luck@intel.com, tomi.valkeinen@ti.com, m.chehab@samsung.com, gregkh@linuxfoundation.org, m.szyprowski@samsung.com, kyungmin.park@samsung.com, k.kozlowski@samsung.com Cc: linux-kernel@vger.kernel.org, chuansheng.liu@intel.com, baolex.ni@intel.com, akpm@linux-foundation.org, hannes@cmpxchg.org, kirill.shutemov@linux.intel.com, vdavydov@virtuozzo.com, oneukum@suse.com Subject: [PATCH 1059/1285] Replace numeric parameter like 0444 with macro Date: Tue, 2 Aug 2016 20:12:40 +0800 Message-Id: <20160802121240.20710-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/pstore/ram.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index bd9812e..7ba7921 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -39,44 +39,44 @@ #define MIN_MEM_SIZE 4096UL static ulong record_size = MIN_MEM_SIZE; -module_param(record_size, ulong, 0400); +module_param(record_size, ulong, S_IRUSR); MODULE_PARM_DESC(record_size, "size of each dump done on oops/panic"); static ulong ramoops_console_size = MIN_MEM_SIZE; -module_param_named(console_size, ramoops_console_size, ulong, 0400); +module_param_named(console_size, ramoops_console_size, ulong, S_IRUSR); MODULE_PARM_DESC(console_size, "size of kernel console log"); static ulong ramoops_ftrace_size = MIN_MEM_SIZE; -module_param_named(ftrace_size, ramoops_ftrace_size, ulong, 0400); +module_param_named(ftrace_size, ramoops_ftrace_size, ulong, S_IRUSR); MODULE_PARM_DESC(ftrace_size, "size of ftrace log"); static ulong ramoops_pmsg_size = MIN_MEM_SIZE; -module_param_named(pmsg_size, ramoops_pmsg_size, ulong, 0400); +module_param_named(pmsg_size, ramoops_pmsg_size, ulong, S_IRUSR); MODULE_PARM_DESC(pmsg_size, "size of user space message log"); static unsigned long long mem_address; -module_param(mem_address, ullong, 0400); +module_param(mem_address, ullong, S_IRUSR); MODULE_PARM_DESC(mem_address, "start of reserved RAM used to store oops/panic logs"); static ulong mem_size; -module_param(mem_size, ulong, 0400); +module_param(mem_size, ulong, S_IRUSR); MODULE_PARM_DESC(mem_size, "size of reserved RAM used to store oops/panic logs"); static unsigned int mem_type; -module_param(mem_type, uint, 0600); +module_param(mem_type, uint, S_IRUSR | S_IWUSR); MODULE_PARM_DESC(mem_type, "set to 1 to try to use unbuffered memory (default 0)"); static int dump_oops = 1; -module_param(dump_oops, int, 0600); +module_param(dump_oops, int, S_IRUSR | S_IWUSR); MODULE_PARM_DESC(dump_oops, "set to 1 to dump oopses, 0 to only dump panics (default 1)"); static int ramoops_ecc; -module_param_named(ecc, ramoops_ecc, int, 0600); +module_param_named(ecc, ramoops_ecc, int, S_IRUSR | S_IWUSR); MODULE_PARM_DESC(ramoops_ecc, "if non-zero, the option enables ECC support and specifies " "ECC buffer size in bytes (1 is a special value, means 16 " -- 2.9.2