lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue,  2 Aug 2016 20:12:40 +0800
From:	Baole Ni <baolex.ni@...el.com>
To:	anton@...msg.org, ccross@...roid.com, keescook@...omium.org,
	tony.luck@...el.com, tomi.valkeinen@...com, m.chehab@...sung.com,
	gregkh@...uxfoundation.org, m.szyprowski@...sung.com,
	kyungmin.park@...sung.com, k.kozlowski@...sung.com
Cc:	linux-kernel@...r.kernel.org, chuansheng.liu@...el.com,
	baolex.ni@...el.com, akpm@...ux-foundation.org, hannes@...xchg.org,
	kirill.shutemov@...ux.intel.com, vdavydov@...tuozzo.com,
	oneukum@...e.com
Subject: [PATCH 1059/1285] Replace numeric parameter like 0444 with macro

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 <chuansheng.liu@...el.com>
Signed-off-by: Baole Ni <baolex.ni@...el.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ