[PATCH 0455/1285] Replace numeric parameter like 0444 with macro

From: Baole Ni
Date: Tue Aug 02 2016 - 07:53:14 EST


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@xxxxxxxxx>
Signed-off-by: Baole Ni <baolex.ni@xxxxxxxxx>
---
drivers/media/pci/cx18/cx18-driver.c | 62 ++++++++++++++++++------------------
1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c
index 260e462..15b2ede 100644
--- a/drivers/media/pci/cx18/cx18-driver.c
+++ b/drivers/media/pci/cx18/cx18-driver.c
@@ -109,37 +109,37 @@ static int retry_mmio = 1;

int cx18_debug;

-module_param_array(tuner, int, &tuner_c, 0644);
-module_param_array(radio, int, &radio_c, 0644);
-module_param_array(cardtype, int, &cardtype_c, 0644);
-module_param_string(pal, pal, sizeof(pal), 0644);
-module_param_string(secam, secam, sizeof(secam), 0644);
-module_param_string(ntsc, ntsc, sizeof(ntsc), 0644);
-module_param_named(debug, cx18_debug, int, 0644);
-module_param(mmio_ndelay, int, 0644);
-module_param(retry_mmio, int, 0644);
-module_param(cx18_pci_latency, int, 0644);
-module_param(cx18_first_minor, int, 0644);
-
-module_param(enc_ts_buffers, int, 0644);
-module_param(enc_mpg_buffers, int, 0644);
-module_param(enc_idx_buffers, int, 0644);
-module_param(enc_yuv_buffers, int, 0644);
-module_param(enc_vbi_buffers, int, 0644);
-module_param(enc_pcm_buffers, int, 0644);
-
-module_param(enc_ts_bufsize, int, 0644);
-module_param(enc_mpg_bufsize, int, 0644);
-module_param(enc_idx_bufsize, int, 0644);
-module_param(enc_yuv_bufsize, int, 0644);
-module_param(enc_pcm_bufsize, int, 0644);
-
-module_param(enc_ts_bufs, int, 0644);
-module_param(enc_mpg_bufs, int, 0644);
-module_param(enc_idx_bufs, int, 0644);
-module_param(enc_yuv_bufs, int, 0644);
-module_param(enc_vbi_bufs, int, 0644);
-module_param(enc_pcm_bufs, int, 0644);
+module_param_array(tuner, int, &tuner_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_array(radio, int, &radio_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_array(cardtype, int, &cardtype_c, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_string(pal, pal, sizeof(pal), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_string(secam, secam, sizeof(secam), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_string(ntsc, ntsc, sizeof(ntsc), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param_named(debug, cx18_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(mmio_ndelay, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(retry_mmio, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(cx18_pci_latency, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(cx18_first_minor, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+module_param(enc_ts_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_mpg_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_idx_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_yuv_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_vbi_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_pcm_buffers, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+module_param(enc_ts_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_mpg_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_idx_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_yuv_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_pcm_bufsize, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+module_param(enc_ts_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_mpg_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_idx_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_yuv_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_vbi_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+module_param(enc_pcm_bufs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);

MODULE_PARM_DESC(tuner, "Tuner type selection,\n"
"\t\t\tsee tuner.h for values");
--
2.9.2