lkml.org 
[lkml]   [2016]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 0092/1285] Replace numeric parameter like 0444 with macro
Date
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@intel.com>
Signed-off-by: Baole Ni <baolex.ni@intel.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
\
 
 \ /
  Last update: 2016-08-02 18:41    [W:0.088 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site