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 18:39:57 +0800
From:	Baole Ni <baolex.ni@...el.com>
To:	josh.h.morris@...ibm.com, pjk1939@...ux.vnet.ibm.com, pavel@....cz,
	gregkh@...uxfoundation.org, hpa@...or.com, x86@...nel.org
Cc:	linux-kernel@...r.kernel.org, axboe@...com, jmoyer@...hat.com,
	ming.l@....samsung.com, chuansheng.liu@...el.com,
	baolex.ni@...el.com
Subject: [PATCH 0092/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>
---
 drivers/block/skd_main.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index 910e065..0dad1c3 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -405,14 +405,14 @@ static inline void skd_reg_write64(struct skd_device *skdev, u64 val,
 #define SKD_IRQ_DEFAULT SKD_IRQ_MSI
 static int skd_isr_type = SKD_IRQ_DEFAULT;
 
-module_param(skd_isr_type, int, 0444);
+module_param(skd_isr_type, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skd_isr_type, "Interrupt type capability."
 		 " (0==legacy, 1==MSI, 2==MSI-X, default==1)");
 
 #define SKD_MAX_REQ_PER_MSG_DEFAULT 1
 static int skd_max_req_per_msg = SKD_MAX_REQ_PER_MSG_DEFAULT;
 
-module_param(skd_max_req_per_msg, int, 0444);
+module_param(skd_max_req_per_msg, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skd_max_req_per_msg,
 		 "Maximum SCSI requests packed in a single message."
 		 " (1-14, default==1)");
@@ -421,26 +421,26 @@ MODULE_PARM_DESC(skd_max_req_per_msg,
 #define SKD_MAX_QUEUE_DEPTH_DEFAULT_STR "64"
 static int skd_max_queue_depth = SKD_MAX_QUEUE_DEPTH_DEFAULT;
 
-module_param(skd_max_queue_depth, int, 0444);
+module_param(skd_max_queue_depth, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skd_max_queue_depth,
 		 "Maximum SCSI requests issued to s1120."
 		 " (1-200, default==" SKD_MAX_QUEUE_DEPTH_DEFAULT_STR ")");
 
 static int skd_sgs_per_request = SKD_N_SG_PER_REQ_DEFAULT;
-module_param(skd_sgs_per_request, int, 0444);
+module_param(skd_sgs_per_request, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skd_sgs_per_request,
 		 "Maximum SG elements per block request."
 		 " (1-4096, default==256)");
 
 static int skd_max_pass_thru = SKD_N_SPECIAL_CONTEXT;
-module_param(skd_max_pass_thru, int, 0444);
+module_param(skd_max_pass_thru, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skd_max_pass_thru,
 		 "Maximum SCSI pass-thru at a time." " (1-50, default==32)");
 
-module_param(skd_dbg_level, int, 0444);
+module_param(skd_dbg_level, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skd_dbg_level, "s1120 debug level (0,1,2)");
 
-module_param(skd_isr_comp_limit, int, 0444);
+module_param(skd_isr_comp_limit, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(skd_isr_comp_limit, "s1120 isr comp limit (0=none) default=4");
 
 /* Major device number dynamically assigned. */
-- 
2.9.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ