Skip to contentSkip to conversation

Replace numeric parameter like 0444 with macro

PATCH NAK Baole Ni 1 participant 1 message Aug 2, 2016

Subsystems (2)
lore
Share & tools
lore

Baole Ni

author
#0 lore raw

PATCH 885/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.

---
 drivers/s390/cio/cmf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/cio/cmf.c +4 -4
index b2afad5..2b8b387 100644
@@ -96,7 +96,7 @@ enum cmb_format {
  * enum cmb_format.
  */
 static int format = CMF_AUTODETECT;
-module_param(format, bint, 0444);
+module_param(format, bint, S_IRUSR | S_IRGRP | S_IROTH);
 
 /**
  * struct cmb_operations - functions to use depending on cmb_format
@@ -470,7 +470,7 @@ static struct cmb_area cmb_area = {
  * maximum is 4096.
  */
 
-module_param_named(maxchannels, cmb_area.num_channels, uint, 0444);
+module_param_named(maxchannels, cmb_area.num_channels, uint, S_IRUSR | S_IRGRP | S_IROTH);
 
 /**
  * struct cmb - basic channel measurement block
@@ -1106,9 +1106,9 @@ cmf_attr_avg(device_active_only_time);
 cmf_attr_avg(device_busy_time);
 cmf_attr_avg(initial_command_response_time);
 
-static DEVICE_ATTR(avg_sample_interval, 0444, cmb_show_avg_sample_interval,
+static DEVICE_ATTR(avg_sample_interval, S_IRUSR | S_IRGRP | S_IROTH, cmb_show_avg_sample_interval,
 		   NULL);
-static DEVICE_ATTR(avg_utilization, 0444, cmb_show_avg_utilization, NULL);
+static DEVICE_ATTR(avg_utilization, S_IRUSR | S_IRGRP | S_IROTH, cmb_show_avg_utilization, NULL);
 
 static struct attribute *cmf_attributes[] = {
 	&dev_attr_avg_sample_interval.attr,
Signature · 1 line
2.9.2